I am in the process of moving Terry's Inkscape driver into Leo's
core. This involves significant repackaging.
Terry, it will probably be easiest for me if you make further
improvements to the LeoInkscapeCommands class. At present, this code
is in leo/core/leoInkscape.py, but this morning I realize I would
rather move this code into leoRst.py. I'll do this right after
sending this post.
The packaging issues are interesting:
1. c.inkscapeCommands
During startup Leo (c.finishCreate) sets c.inkscapeCommands to an
instance of LeoInkscapeCommands. This will be true regardless of
where the LeoInkscapeCommands finally resides.
2. Settings and arguments
Rather than command-line args, we have a combination of Leo settings
and arguments passed to c.inkscapeCommands.run().
2A. Settings
@string inkscape-bin
This setting tells Leo where inkscape is. It is set only once, at
startup, in the ctor of LeoInkscapeCommands. Of course, you could
define it in multiple places, say in myLeoSettings.leo and
myDocuments.leo, but that's not likely to be too useful.
2B. Arguments to run():
These can be changed on every call:
fn, # Required: the name of the screenshot file (.png) file.
callouts, # A possibly empty list of callout text.
numbers, # A possibly empty list of callout numbers.
edit_flag = True, # True: call inkscape to edit the working file.
png_fn=None, # Optional: Name of output png file.
svg_fn=None, # Optional: Name of working svg file.
template_fn=None, # Optional: Name of template svg file.
The arguments to run replace *all* the command-line arguments. For
example, run() calls make_png only if png_fn exists.
No doubt these details will "twitch" a bit as I start using this code
for real. The intention is to fully integrate this code with the
@button screenshot and @slideshow trees.
There is room for significant invention here. The interaction of rST
markup (including "controlling" comments) @slideshow trees and
c.inkscapeCommands.run() is a fertile field. I'll be playing with the
possibilities today.
Edward
--
You received this message because you are subscribed to the Google Groups
"leo-editor" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/leo-editor?hl=en.