mirror of
https://gitlab.freedesktop.org/dbus/dbus.git
synced 2025-12-23 03:40:08 +01:00
- added new type classes for hinting to the marashaler what type to send over the wire - added int16 and uint16 marshalers - Fixed a bug in the type constants that caused int32 to go out as uint16 over the wire * python/dbus.py: split up into different files and renamed _dbus.py * python/__init__.py, python/_util.py, python/decorators.py, python/exceptions.py, python/proxies.py, python/services.py, python/types.py: new files split off from dbus.py * python/Makefile.am: Add new files, remove dbus.py and install all python files to <python module dir>/dbus * python/examples/*: Added #!/usr/bin/env python to the top of every example. Patch provided by Tatavarty Kalyan
26 lines
717 B
Python
26 lines
717 B
Python
#!/usr/bin/env python
|
|
|
|
import dbus
|
|
import gtk
|
|
|
|
class TestObject(dbus.Object):
|
|
def __init__(self, service):
|
|
dbus.Object.__init__(self, "/org/designfu/TestService/object", service)
|
|
|
|
@dbus.signal('org.designfu.TestService')
|
|
def HelloSignal(self, message):
|
|
# The signal is emitted when this method exits
|
|
# You can have code here if you wish
|
|
pass
|
|
|
|
@dbus.method('org.designfu.TestService')
|
|
def emitHelloSignal(self):
|
|
#you emit signals by calling the signal's skeleton method
|
|
self.HelloSignal("Hello")
|
|
return "Signal emitted"
|
|
|
|
session_bus = dbus.SessionBus()
|
|
service = dbus.Service("org.designfu.TestService", bus=session_bus)
|
|
object = TestObject(service)
|
|
|
|
gtk.main()
|