dbus/python/tests/test-server.py
Seth Nickell d027c99375 2004-05-30 Seth Nickell <seth@gnome.org>
* python/dbus.py:

	Add a nicer-but-less-flexible alternate API for handling
	calls to virtual objects in dbus.ObjectTree.

	Screw up the argument order to the dbus.Object constructor
	for consistency with dbus.ObjectTree (and to make dbus_methods
	optional for future extension)

	* python/examples/Makefile.am:
	* python/examples/gconf-proxy-service.py:
	* python/examples/gconf-proxy-service2.py:

	Alternate implementation of gconf-proxy-service using the
	nicer dbus.ObjectTree API.

	* python/examples/example-service.py:
	* python/tests/test-server.py

	Reverse the argument order to deal with dbus.Object constructor
	changes.
2004-05-30 08:20:58 +00:00

17 lines
417 B
Python

import dbus
import gtk
class TestObject(dbus.Object):
def __init__(self, service):
method_list = [ self.Echo ]
dbus.Object.__init__(self, "/TestObject", service, method_list)
def Echo(self, variable):
return variable
session_bus = dbus.SessionBus()
local_service = dbus.Service("org.designfu.Test", bus=session_bus)
local_object = TestObject(local_service)
gtk.main()