diff options
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | python/examples/example-service.py | 4 | ||||
-rw-r--r-- | python/examples/example-signal-emitter.py | 10 |
3 files changed, 13 insertions, 7 deletions
@@ -1,5 +1,11 @@ 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 diff --git a/python/examples/example-service.py b/python/examples/example-service.py index 00f39935..ce871a1f 100644 --- a/python/examples/example-service.py +++ b/python/examples/example-service.py @@ -7,8 +7,8 @@ import pygtk 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): diff --git a/python/examples/example-signal-emitter.py b/python/examples/example-signal-emitter.py index 64474e8f..f81ac3fb 100644 --- a/python/examples/example-signal-emitter.py +++ b/python/examples/example-signal-emitter.py @@ -5,8 +5,8 @@ import dbus.service 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): @@ -17,11 +17,11 @@ class TestObject(dbus.service.Object): @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() |