python bindings

John (J5) Palmieri johnp at redhat.com
Mon Jun 13 12:39:15 PDT 2005


Just tried this and it works:

import gobject

mainloop = gobject.MainLoop()
mainloop.run()

Hope that helps.

On Mon, 2005-06-13 at 12:26 -0700, Sean Meiners wrote:
> I'm working on a D-BUS based (version 0.33) daemon using the python bindings 
> and have run into a snag.  The daemon will be only be communicating on the 
> system bus and will be starting on boot like most other daemons.  The problem 
> is that as far as I can tell the only way to receive events is by calling 
> gtk.main() to enter the gtk even loop.  Of course, since there is no X server 
> running, the whole program fails to even load with the following error:
> 
> Traceback (most recent call last):
>   File "./netd.py", line 10, in ?
>     import gtk
>   File "/usr/lib/python2.3/site-packages/gtk-2.0/gtk/__init__.py", line 37, 
> in ?
>     from _gtk import *
> RuntimeError: could not open display
> 
> Does anyone know how to get around this (without starting an X server)?

> -- 
> Sean Meiners
> Sean.Meiners at LinspireInc.com
> 
> 
> Perl - $Just @when->$you ${thought} s/yn/tax/ &couldn\'t %get $worse;
-- 
John (J5) Palmieri
Associate Software Engineer
Desktop Group
Red Hat, Inc.
Blog: http://martianrock.com



More information about the dbus mailing list