File: example-service.py

package info (click to toggle)
dbus 0.23.4-1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 7,112 kB
  • ctags: 4,832
  • sloc: ansic: 58,374; sh: 8,603; xml: 7,376; cs: 3,348; cpp: 1,043; makefile: 767; python: 523; java: 15
file content (18 lines) | stat: -rw-r--r-- 457 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import dbus

import pygtk
import gtk

class SomeObject(dbus.Object):
    def __init__(self, service):
        dbus.Object.__init__(self, "/SomeObject", service, [self.HelloWorld])

    def HelloWorld(self, message, hello_message):
        print (hello_message)
        return ["Hello", "from example-service.py"]

session_bus = dbus.SessionBus()
service = dbus.Service("org.designfu.SampleService", bus=session_bus)
object = SomeObject(service)

gtk.main()