dbus/python/examples/example-service.py
Seth Nickell 5d6113aaa0 2004-05-29 Seth Nickell <seth@gnome.org>
* python/dbus.py:
	* python/examples/example-client.py:
	* python/examples/example-service.py:
	* python/examples/list-system-services.py:

	Add SessionBus, SystemBus and ActivationBus classes
	so you don't need to know the special little BUS_TYPE
	flag.
2004-05-29 22:37:13 +00:00

18 lines
443 B
Python

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)
object = SomeObject(service)
gtk.main()