Forum: Inkscape DBus API

7ffaeb50cad696241dd94520ddb51a7f?d=identicon&s=25 Brian Lewis (Guest)
on 2013-02-13 14:01
(Received via mailing list)
I got code from bzr and built with --enable-dbus-api.

In /usr/share/dbus-1/services, I added org.inkscape.service:
[D-BUS Service]
Name=org.inkscape
Exec=/usr/bin/inkscape

Code like
import dbus
bus = dbus.SessionBus()
inkdoc1 = bus.get_object('org.inkscape', '/org/inkscape/desktop_0')

causes inkscape to start via dbus, but the bus.get_object doesn't
succeed. I get an error from DBus:

dbus.exceptions.DBusException:
org.freedesktop.DBus.Error.NameHasNoOwner: Could not get owner of name
'org.inkscape': no such name

What else do I need to do?
7ffaeb50cad696241dd94520ddb51a7f?d=identicon&s=25 Brian Lewis (Guest)
on 2013-02-14 11:46
(Received via mailing list)
On 2013.02.13, at 06:44, Brian Lewis wrote:
> I got code from bzr and built with --enable-dbus-api.

Doh. After building with correct flag "--enable-dbusapi", things are
working better. Sorry for the noise.
7ffaeb50cad696241dd94520ddb51a7f?d=identicon&s=25 Brian Lewis (Guest)
on 2013-02-15 11:22
(Received via mailing list)
If I use the dbus API to call_verb
"ru.cnc-club.filter.gcodetools_orientation_no_options_no_preferences", I
get a crash. What's a good way to figure out what's happening?
Aefd46e73e6b7449c5ce1ce0156797d2?d=identicon&s=25 ~suv (Guest)
on 2013-02-15 12:15
(Received via mailing list)
On 2013-02-15 11:20 +0100, Brian Lewis wrote:
> If I use the dbus API to call_verb
> "ru.cnc-club.filter.gcodetools_orientation_no_options_no_preferences", I
> get a crash. What's a good way to figure out what's happening?


Attached is a backtrace of the crash with r12126 (of limited use - I
don't have a debug build for the dbus-api available).

Seems to affect all verbs based on extensions AFAICT:

Also reproducible with script-based color effects without dialog, e.g.
   "org.inkscape.color.negative"
or those which open a dialog
   "org.inkscape.color.randomize"
and with internal effects called without dialog like e.g.
   "org.inkscape.effect.filter.ColorDropShadow.noprefs"

On the other hand, this one
   "org.inkscape.effect.filter.ColorDropShadow"
works, and allows to interactively apply the effect).

Possibly a regression, but I don't know for sure.
Aefd46e73e6b7449c5ce1ce0156797d2?d=identicon&s=25 ~suv (Guest)
on 2013-02-15 13:40
(Received via mailing list)
On 2013-02-15 11:20 +0100, Brian Lewis wrote:
> If I use the dbus API to call_verb
> "ru.cnc-club.filter.gcodetools_orientation_no_options_no_preferences", I
> get a crash. What's a good way to figure out what's happening?

Oddly, it seems to work without crash if pausing updates before calling
the
verb, and resuming it afterwards:


Python sample code:

def testGCode2(doc):
   doc.pause_updates()
   doc.call_verb("ru.cnc-club.filter.gcodetools_orientation_no_options_no_preferences")
   doc.resume_updates()
Please log in before posting. Registration is free and takes only a minute.
Existing account

NEW: Do you have a Google/GoogleMail, Yahoo or Facebook account? No registration required!
Log in with Google account | Log in with Yahoo account | Log in with Facebook account
No account? Register here.