Fixed a few warnings.
[tangerine.git] / rom / dbus / test / dbus-ping-send.py
blob87db3d78fa83110fb3c97b90906cf9e83770ed84
1 #! /usr/bin/env python
3 import gtk
4 import dbus
6 # Connect to the bus
7 bus = dbus.Bus()
9 # Create a service on the bus
10 service = dbus.Service("com.burtonini.dbus.SignalService", bus)
12 # Define a D-BUS object
13 class SignalObject(dbus.Object):
14 def __init__(self, service):
15 dbus.Object.__init__(self, "/", [], service)
17 # Create an instance of the object, which is part of the service
18 signal_object = SignalObject(service)
20 def send_ping():
21 signal_object.broadcast_signal("com.burtonini.dbus.Signal", "Ping")
22 print "Ping!"
23 return gtk.TRUE
25 # Call send_ping every second to send the signal
26 gtk.timeout_add(1000, send_ping)
27 gtk.main()