dbus/python/exceptions.py
Robert McQueen b5e4d26ade 2005-11-15 Robert McQueen <robot101@debian.org>
* 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.
2005-11-15 17:19:19 +00:00

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)