* python/examples/example-service.py,
authorJohn (J5) Palmieri <johnp@redhat.com>
Fri, 15 Jul 2005 18:09:59 +0000 (18:09 +0000)
committerJohn (J5) Palmieri <johnp@redhat.com>
Fri, 15 Jul 2005 18:09:59 +0000 (18:09 +0000)
  python/examples/example-signal-emitter.py: Fixed up examples
  for API changes

ChangeLog
python/examples/example-service.py
python/examples/example-signal-emitter.py

index dc0e1d3..89a17ba 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -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
 
index 00f3993..ce871a1 100644 (file)
@@ -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):
index 64474e8..f81ac3f 100644 (file)
@@ -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()