DBus Interface -- Compiling, Status and Usage Help?
Hi All,
TL;DR I've put forth some solid effort on the following, but need help: - how do I properly compile Inkscape 0.91 with DBus enabled? - I'm getting errors calling basic methods using the DBus API, eg. save() and save_as(), are others seeing this? - is the DBus API maintained?
__ Some background first: __
My goal here is to automate some repetitive tasks across tens of thousands of SVGs. My approach uses a combination of these methods/verbs: load, selection_ungroup, object_to_path, selection_combine (union and exclusion), select_move, save_as.
This is my first attempt at compiling Inkscape and using the DBus API, so I suspect the problem probably lies on my end. I'd appreciate pointers to help correct my ways.
__ What I've done: __
I'm running an Ubuntu 14.04 image within VirtualBox. Here's how I've compiled Inkscape. Also I show a simple DBus test case, via python, which fails on save() and save_as().
# __ Install dependencies and get machine setup __ $ lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 14.04.1 LTS Release: 14.04 Codename: trusty $ sudo apt-get update $ sudo apt-get install git bzr dbus build-essential autoconf automake autopoint intltool libtool libglib2.0-dev libpng12-dev libgc-dev libfreetype6-dev liblcms1-dev libgtkmm-2.4-dev libxslt1-dev libboost-dev libpopt-dev libgsl0-dev libaspell-dev libpoppler-dev libpoppler-glib-dev libssl-dev graphicsmagick-libmagick-dev-compat libwpg-dev libcdr-dev libvisio-dev libgnomevfs2-dev dbus-x11 libdbus-1-dev libdbus-glib-1-dev checkinstall xvfb curl $ sudo apt-get upgrade $ sudo apt-get autoremove $ sudo shutdown -r now
# __ Download and build Inkscape __ $ wget https://inkscape.global.ssl.fastly.net/media/resources/file/inkscape-0.91.ta... # recently released 0.91 tarball $ tar -xvf inkscape-0.91.tar.gz $ cd inkscape-0.91/ $ ./configure --enable-dbusapi $ make $ sudo make install $ inkscape --version Inkscape 0.91 r13725 (Jan 29 2015)
# __ DBus interface test case ( http://ryanlerch.org/inkscape-dbus-documentation/#idm262544986224) __ $ echo $HOME /home/osboxes $ python Python 2.7.6 (default, Mar 22 2014, 22:59:56) [GCC 4.8.2] on linux2 Type "help", "copyright", "credits" or "license" for more information.
import dbus bus = dbus.SessionBus() inkapp = bus.get_object('org.inkscape', '/org/inkscape/application') desk2 = inkapp.desktop_new(dbus_interface='org.inkscape.application') inkdoc1 = bus.get_object('org.inkscape', desk2) doc1 = dbus.Interface(inkdoc1, dbus_interface="org.inkscape.document") doc1.rectangle (0,0,100,100)
dbus.String(u'rect18')
doc1.save_as("/home/osboxes/save-as-test.svg")
Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/lib/python2.7/dist-packages/dbus/proxies.py", line 145, in __call__ **keywords) File "/usr/lib/python2.7/dist-packages/dbus/connection.py", line 651, in call_blocking message, timeout) dbus.exceptions.DBusException: org.freedesktop.DBus.GLib.ErrorError: Method invoked for save_as returned FALSE but did not set error
doc1.save()
Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/lib/python2.7/dist-packages/dbus/proxies.py", line 145, in __call__ **keywords) File "/usr/lib/python2.7/dist-packages/dbus/connection.py", line 651, in call_blocking message, timeout) dbus.exceptions.DBusException: org.freedesktop.DBus.GLib.ErrorError: Method invoked for save returned FALSE but did not set error
# Note -- the net effect of the above in Inkscape is 2 open desktops: "New document 1" which is blank and unmodified, and "*New document 2" which correctly shows a 100x100 (blue) rectangle but is unsaved and for which I do not see any saved SVGs on my machine
__ Help? __
Back to my initial Qs. Am I setting up prereqs and compiling Inkscape correctly to use the DBus API?
Is the above test case reflective of a known issue on the DBus API or am I in the wrong?
If it looks correct, I'm wondering if the DBus interface is still maintained, or incomplete, or subject to a regression?
I'm hoping to sort this out for my purposes, but also think that this would generate a helpful "how-to" for anyone wishing to get DBus up and running on 0.91.
Cheers and congrats on 0.91!
-- Mike Jarema e: mike@...3206... w: mikejarema.com m: +1-905-399-4291
participants (1)
-
Mike Jarema