[PyQt] dbus and PyKDE

Jim Bublitz jbublitz at nwinternet.com
Sun Mar 30 20:54:55 BST 2008


On Thursday 27 March 2008 10:11, Jonathan Riddell wrote:
> I'm trying to get a printer applet into KDE (see kde-core-devel),
> however I can't actually use pyKDE because oxygen style and
> KApplication load QtDbus which causes the application to freeze when
> I'm using python-dbus.
>
> For example this app freezes when using KApplication but not when
> using QApplication.
>
> http://kubuntu.org/~jriddell/tmp/minimal.py
>
> Does anyone have any ideas on how to work around this?

With QApplication, I get:

Traceback (most recent call last):
  File "minimal.py", line 63, in <module>
    applet = PrinterApplet()
  File "minimal.py", line 33, in __init__
    bus_name = dbus.service.BusName (PDS_OBJ, bus=bus)
  File "/usr/lib/python2.5/site-packages/dbus/service.py", line 113, in 
__new__
    retval = bus.request_name(name, name_flags)
dbus.DBusException: org.freedesktop.DBus.Error.AccessDenied: Connection 
":1.102" is not allowed to own the service 
"com.redhat.NewPrinterNotification" due to security policies in the 
configuration file

That's the same point at which the program hangs using KApplication. (That's 
also without Oxygen, which is a different problem).

KApplication uses QtDBus, so there's no eliminating that. That should ensure 
the application gets automatically registered though. You can change the 
organization domain via KAboutData - didn't try that though.

I guess what I'd try is some simpler stuff - see if you can communicate via 
DBus at all, query for available services - in general, see if anything 
works. If it doesn't, maybe it'll turn up something that provides more 
insight. Send me whatever you come up with (working or not) and I'll see 
where I can go from there.

I really have no understanding of the whole subject and it looks like a few 
weeks of learning curve for me to dig into it much more. Doesn't look like a 
quick fix is available from this end, but I'm certainly willing to go at it.

Jim


More information about the PyQt mailing list