2005-07-15 John (J5) Palmieri <johnp@redhat.com>
+ * python/examples/example-service.py,
+ python/examples/example-signal-emitter.py: Fixed up examples
+ for API changes
+
+2005-07-15 John (J5) Palmieri <johnp@redhat.com>
+
* python/__init__.py: Upped to version (0,42,0) because of
the API change
import gtk
class SomeObject(dbus.service.Object):
- def __init__(self, name):
- dbus.service.Object.__init__(self, "/SomeObject", name)
+ def __init__(self, bus_name, object_path="/SomeObject"):
+ dbus.service.Object.__init__(self, bus_name, object_path)
@dbus.service.method("org.designfu.SampleInterface")
def HelloWorld(self, hello_message):
import gtk
class TestObject(dbus.service.Object):
- def __init__(self, name):
- dbus.service.Object.__init__(self, "/org/designfu/TestService/object", name)
+ def __init__(self, bus_name, object_path='/org/designfu/TestService/object'):
+ dbus.service.Object.__init__(self, bus_name, object_path)
@dbus.service.signal('org.designfu.TestService')
def HelloSignal(self, message):
@dbus.service.method('org.designfu.TestService')
def emitHelloSignal(self):
#you emit signals by calling the signal's skeleton method
- self.HelloSignal("Hello")
- return "Signal emitted"
+ self.HelloSignal('Hello')
+ return 'Signal emitted'
session_bus = dbus.SessionBus()
-name = dbus.service.BusName("org.designfu.TestService", bus=session_bus)
+name = dbus.service.BusName('org.designfu.TestService', bus=session_bus)
object = TestObject(name)
gtk.main()