summaryrefslogtreecommitdiffstats
path: root/python/examples/example-service.py
diff options
context:
space:
mode:
authorHavoc Pennington <hp@redhat.com>2003-09-30 02:41:13 +0000
committerHavoc Pennington <hp@redhat.com>2003-09-30 02:41:13 +0000
commit0469cdb2c7a504f4d47a08cc3c482f26babb2cc4 (patch)
treeb2dce5ab044645f5febd7f712ab63781b80ddaaf /python/examples/example-service.py
parent42019c962537b940311573b1ec62495b973b5bfd (diff)
add examples
Diffstat (limited to 'python/examples/example-service.py')
-rw-r--r--python/examples/example-service.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/python/examples/example-service.py b/python/examples/example-service.py
new file mode 100644
index 00000000..79fb009d
--- /dev/null
+++ b/python/examples/example-service.py
@@ -0,0 +1,18 @@
+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"
+
+
+service = dbus.Service("org.designfu.SampleService")
+object = SomeObject(service)
+
+gtk.main()