Re: dia python plugin, how to store temporary information during export



At 26.03.2009 21:42, Sebastian Setzer wrote:
Hi,
is there some way to store information in the dia objects during export
with a python plugin?

Depends on what version of Dia you are using. With 0.97-pre there is generic object metainfo. Just use:

        obj.properties["meta"] = {'mykey' : 'myvalue' }

which then gets stored and loaded with Dia's standard load/save.

For example, I want to give each state of a UML state diagram a unique
number.

Is this generate from PyDia? Maybe you can show some source?
(Given the recent increase in PyDia questions I wonder why there are no user provide PyDia plug-ins. Are you all just developing proprietary stuff?)

I can store that information in a dictionary with the object as key. But
that's inconvenient because I have to pass this dictionary around. So I
wonder if there's a better way.

I don't understand this. Are you already using the meta facility?

Just assigning to a new member of the objects or adding "properties"
doesn't seem to work.

See above.

        Hans

-------- Hans "at" Breuer "dot" Org -----------
Tell me what you need, and I'll tell you how to
get along without it.                -- Dilbert



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]