mirror of
https://gitlab.freedesktop.org/dbus/dbus.git
synced 2025-12-28 21:20:10 +01:00
* bus/driver.c, bus/services.c, bus/services.h: Add a ReleaseName method to org.freedesktop.DBus to release a bus name or give up waiting in the queue for it. * dbus/dbus-bus.c, dbus/dbus-bus.h, dbus/dbus-shared.h: Add a dbus_bus_release_name method to send the ReleaseName method calls. Add constants for the return values to dbus/dbus-shared.h. * doc/dbus-specification.xml: Document the new ReleaseName method in the specification. * python/dbus_bindings.pyx: Add a low-level python binding for the release name method. * python/exceptions.py, python/service.py: Make freeing BusName objects release the name. Add a NameExistsException, and fix a bug with creating UnknownMethodException. * test/python/test-client.py: Add tests for freeing BusName objects causing names to be released.
29 lines
1.1 KiB
Python
29 lines
1.1 KiB
Python
import dbus_bindings
|
|
|
|
DBusException = dbus_bindings.DBusException
|
|
ConnectionError = dbus_bindings.ConnectionError
|
|
|
|
class MissingErrorHandlerException(DBusException):
|
|
def __init__(self):
|
|
DBusException.__init__(self, "error_handler not defined: if you define a reply_handler you must also define an error_handler")
|
|
|
|
class MissingReplyHandlerException(DBusException):
|
|
def __init__(self):
|
|
DBusException.__init__(self, "reply_handler not defined: if you define an error_handler you must also define a reply_handler")
|
|
|
|
class ValidationException(DBusException):
|
|
def __init__(self, msg=''):
|
|
DBusException.__init__(self, "Error validating string: %s"%msg)
|
|
|
|
class IntrospectionParserException(DBusException):
|
|
def __init__(self, msg=''):
|
|
DBusException.__init__(self, "Error parsing introspect data: %s"%msg)
|
|
|
|
class UnknownMethodException(DBusException):
|
|
def __init__(self, method):
|
|
DBusException.__init__(self, "Unknown method: %s"%method)
|
|
|
|
class NameExistsException(DBusException):
|
|
def __init__(self, name):
|
|
DBusException.__init__(self, "Bus name already exists: %s"%name)
|
|
|