dbus/python/examples/example-service.py

19 lines
443 B
Python
Raw Normal View History

2003-09-30 02:41:13 +00:00
import dbus
import pygtk
import gtk
class SomeObject(dbus.Object):
def __init__(self, service):
dbus.Object.__init__(self, "/SomeObject", [self.HelloWorld], service)
def HelloWorld(self, hello_message):
print (hello_message)
return "Hello from example-service.py"
session_bus = dbus.SessionBus()
service = dbus.Service("org.designfu.SampleService", bus=session_bus)
2003-09-30 02:41:13 +00:00
object = SomeObject(service)
gtk.main()