self.conn = dbus_connection_open(address,
&error)
if dbus_error_is_set(&error):
- raise DBusException, error.message
+ message = error.message
+ dbus_error_free (&error)
+ raise DBusException, message
def __dealloc__(self):
if self.conn != NULL:
def send_with_reply(self, Message message, timeout_milliseconds):
cdef dbus_bool_t retval
cdef DBusPendingCall *cpending_call
- cdef DBusError error
cdef DBusMessage *msg
cdef PendingCall pending_call
- dbus_error_init(&error)
-
cpending_call = NULL
msg = message._get_msg()
&cpending_call,
timeout_milliseconds)
- if dbus_error_is_set(&error):
- raise DBusException, error.message
-
if (cpending_call != NULL):
pending_call = PendingCall()
pending_call.__cinit__(cpending_call)
&error)
if dbus_error_is_set(&error):
- raise DBusException, error.message
+ message = error.message
+ dbus_error_free (&error)
+ raise DBusException, message
if retval == NULL:
raise AssertionError
self.server = dbus_server_listen(address,
&error)
if dbus_error_is_set(&error):
- raise DBusException, error.message
+ message = error.message
+ dbus_error_free (&error)
+ raise DBusException, message
def disconnect(self):
dbus_server_disconnect(self.server)
&error)
if dbus_error_is_set(&error):
- raise DBusException, error.message
+ message = error.message
+ dbus_error_free(&error)
+ raise DBusException, message
conn = Connection()
conn.__cinit__(None, connection)
retval = dbus_bus_get_unix_user(conn, service_name, &error)
if dbus_error_is_set(&error):
- raise DBusException, error.message
+ message = error.message
+ dbus_error_free(&error)
+ raise DBusException, message
+
return retval
#These are defines, not enums so they aren't auto generated
retval = dbus_bus_start_service_by_name(conn, service_name, flags, &results, &error)
+ if dbus_error_is_set(&error):
+ message = error.message
+ dbus_error_free(&error)
+ raise DBusException, message
+
return (retval, results)
def bus_register(Connection connection):
retval = dbus_bus_register(conn,
&error)
if dbus_error_is_set(&error):
- raise DBusException, error.message
+ message = error.message
+ dbus_error_free(&error)
+ raise DBusException, message
return retval
flags,
&error)
if dbus_error_is_set(&error):
- raise DBusException, error.message
+ message = error.message
+ dbus_error_free(&error)
+ raise DBusException, message
+
return retval
def bus_name_has_owner(Connection connection, service_name):
service_name,
&error)
if dbus_error_is_set(&error):
- raise DBusException, error.message
+ message = error.message
+ dbus_error_free(&error)
+ raise DBusException, message
+
return retval
def bus_add_match(Connection connection, rule):
dbus_bus_add_match (conn, rule, &error)
if dbus_error_is_set(&error):
- raise DBusException, error.message
+ message = error.message
+ dbus_error_free(&error)
+ raise DBusException, message
def bus_remove_match(Connection connection, rule):
cdef DBusError error
dbus_bus_remove_match (conn, rule, &error)
if dbus_error_is_set(&error):
- raise DBusException, error.message
+ message = error.message
+ dbus_error_free(&error)
+ raise DBusException, message