Re: Can you call an export filter from pydia?



At 10.01.2014 19:03, Dan Katz wrote:
Hi -

I’d like to put together an action which would basically do this: 1.
Export current diagram to some format (e.g. SVG) 2. Launch some external
program to operate on the exported diagram 3. Modify the current diagram
based on the output of the external program The net effect is that the
user can run the external program on their diagram by selecting a menu
item, have the result pop up in their current diagram, and continue
working without ever feeling like they left the Dia session.

Most of this is pretty easy with PyDia, but I haven’t found a simple way
to export the current diagram in that API.  The Diagram class has a
save() method that takes an optional name, but nothing I can see that
looks like an “export()” method that would take an export filter name.

Export is indeed a facility not directly available with PyDia. I did some experiments regarding that with the 2nd bindings [1], [2] but that's slightly bitrotten since than. And it wont help with PyDia.

Am I missing something obvious here?

Not that obivous I think, but anyway you should be able to use the exisiting PyDia svg export (diasvg.py) directly from your PyDia plug-in. Making use of Dia's meta info facility might also be an option, depending on the parser of your external program.

[1] https://mail.gnome.org/archives/dia-list/2007-March/msg00092.html
[2] https://git.gnome.org/browse/dia/tree/bindings/test.py#n44

Thanks.

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




--
-------- 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]