summaryrefslogtreecommitdiffstats
path: root/python/examples/example-signal-emitter.py
blob: edabfd703173df4e542a0d1c60dfb0b86c4969aa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import dbus
import gtk

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

    def emitHelloSignal(self, message):
        # Emit the signal
        self.emit_signal(interface="org.designfu.TestService",
                              signal_name="hello")

session_bus = dbus.SessionBus()
service = dbus.Service("org.designfu.TestService", bus=session_bus)
object = TestObject(service)

gtk.main()
A