Re: problems generating code from dia 0.96 to 0.97



Hi Ottavio
a quick and dirty workaround for getting version of dia in use, 
could be (try in dia python console)

from subprocess import Popen, PIPE
diaVersionString = Popen("dia  --version", shell=True, stdout=PIPE).stdout.read().strip()
print diaVersionString

diaVersionString should contain something similar to this : "Dia version 0.97, compiled 17:24:55 Nov  8 2011"

Carlo



2012/2/8 Steffen Macke <dia diagramr biz>
Hi Ottavio,


On 02/08/2012 11:40 AM, Ottavio Campana wrote:
                        for o in layer.objects :
                                for c in o.connections:
                                        for n in c.connected:
                                                if not n.type.name in
("UML - Association"):

                ...

It works perfectly on dia 0.96 . But when I try to run it in dia 0.97
c.connected is always empty.
Could you add another loop over n? e.g.

for co in n:
   if not co.type.name in ("UML - Association"):



I also have another question: suppose I want to make my python plugin
work both with dia 0.96 and 0.97. Is there a way to get the version of
dia in the plugin?
At a first glance, I didn't see any Python function returning a Dia version number. But you could simply
check the object type where the code differs

Regards,

Steffen

_______________________________________________
dia-list mailing list
dia-list gnome org
http://mail.gnome.org/mailman/listinfo/dia-list
FAQ at http://live.gnome.org/Dia/Faq
Main page at http://live.gnome.org/Dia




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