dbus/python/examples/example-signal-recipient.py
Seth Nickell 233f8d0e33 2004-07-10 Seth Nickell <seth@gnome.org>
* python/dbus.py:

	Add "message" argument to service-side dbus.Object
	methods. This will break existing services written
	using the python bindings, but will allow extraction
	of all the message information (e.g. who its from).

	Add improved "object oriented" signal handling/emission.

	* python/examples/example-service.py:

	Nix this example.

	* python/examples/example-signal-emitter.py:
	* python/examples/example-signal-recipient.py:

	Two new examples that show how to emit and receive
	signals using the new APIs.

	* python/examples/example-signals.py:
	* python/examples/gconf-proxy-service.py:
	* python/examples/gconf-proxy-service2.py:

	Add "message" argument to service methods.
2004-07-11 03:02:14 +00:00

19 lines
529 B
Python

import gtk
import dbus
bus = dbus.SessionBus()
service = bus.get_service("org.designfu.TestService")
object = service.get_object("/org/designfu/TestService/object", "org.designfu.TestService")
def hello_signal_handler(interface, signal_name, service, path, message):
print ("Received signal '%s.%s' from object '%s%s'"
% (interface, signal_name, service, path))
object.connect_to_signal("hello", hello_signal_handler)
# Tell the remote object to emit the signal
object.emitHelloSignal()
gtk.main()