summaryrefslogtreecommitdiffstats
path: root/python
diff options
context:
space:
mode:
authorJohn (J5) Palmieri <johnp@redhat.com>2005-07-15 18:09:59 +0000
committerJohn (J5) Palmieri <johnp@redhat.com>2005-07-15 18:09:59 +0000
commita89b13dd19740bd308a983650f49148c0bf6d58c (patch)
tree8c7663262c2d530141816240476b0889b298d4eb /python
parent5cd694d5fb254c273bd59428779818216b4a1ed5 (diff)
* python/examples/example-service.py,
python/examples/example-signal-emitter.py: Fixed up examples for API changes
Diffstat (limited to 'python')
-rw-r--r--python/examples/example-service.py4
-rw-r--r--python/examples/example-signal-emitter.py10
2 files changed, 7 insertions, 7 deletions
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()