Hi again,
I've done some DBus work now, so that it's possible to run a command-line only instance of Inkscape, connect to it with DBus, and perform operations on the document (e.g. selection of paths, Boolean operations on selected paths, and saving of the document). Also fixed a couple of minor issues with the DBus interface as I came across them (e.g. setting error messages when certain methods fail). I've not written an example app to augment the existing "pytester.py" DBus script, but can do so if it's useful. The only real difference is that you should start Inkscape with "inkscape <file.svg> -z --dbus-listen" and then use the "get_active_document()" DBus method on the "/org/inkscape/application" interface.
I've trunk-tracked, as suggested, and checked that there are no conflicts, so I've created a merge request (with Martin as the reviewer - hope you don't mind!). I tried to follow the various Bazaar workflow email threads, and I think I've understood how to do it properly, but I'd appreciate if you could double-check as this is my first time using Bazaar.
It would be great if this makes it into trunk, if there are problems then please let me know and I'll attempt to rectify them!
On another note, I wonder if the --enable-dbusapi flag might be enabled in future release builds of Inkscape (especially packages on Ubuntu)? While the API is obviously in a state of flux, it's possible to do useful scripting work with it already (and it's a whole lot better than the --verb --select command-line args way, even if that no longer requires a GUI).
Best, Eric
On 1 July 2013 23:37, Martin Owens <doctormo@...400...> wrote:
On Mon, 2013-07-01 at 22:13 +0100, Eric Greveson wrote:
This now means that you can run Inkscape on the command line with e.g. "inkscape file.svg --select Path1 --select Path2 --verb SelectionDiff -z", and Inkscape will subtract the uppermost path from the lowermost path, and overwrite file.svg with the result, all without ever creating any GUI. This is obviously much faster than before (where the verbs didn't work with -z) and opens the way for other suitable verbs to be modified for console-mode (e.g. server-side) usage, as required.
Eric, I'd like to celebrate your work. This is a very useful feature and I can't wait to see what might be possible with it in the future. *high five*
is it good practice to trunk-track (i.e. merge all changes from trunk to my branch since my branch started) before clicking "propose for merging", or is this not necessary?
It's a requirement. All good merge proposals should be as up to date as possible and conflicts are the responsibility of the proposer if any crop up during review.
Next step: trying to use the DBus interface when running Inkscape in console mode...
That would certainly be interesting, being able to modify svg documents via DBus without an inkscape GUI running.
Warm Regards, Martin Owens