dbus/dbus/python
johnp
freedesktop-cvs-commits at pdx.freedesktop.org
Mon Jun 7 19:35:44 PDT 2004
CVS commit by johnp:
* Python bindings are updated to reflect C API changes which now
accept plain path strings instead of an array of path elements.
M +3 -32 dbus/dbus/python/dbus_bindings.pyx.in 1.11
--- dbus/dbus/python/dbus_bindings.pyx.in #1.10:1.11
@@ -113,8 +113,4 @@
cdef DBusConnection *conn
- # FIXME: this is a major major hack. We use this because casting values to
- # python objects and returning seemed to be corrupting them. This is a "global variable" :-(
- cdef char **_parsed_path
-
def __init__(self, address=None, Connection _conn=None):
cdef DBusConnection *c_conn
@@ -148,20 +144,4 @@
return self.conn
- #FIXME: this is totally busted, don't use a class shared member like parsed_path
- def _build_parsed_path(self, path_element_list):
- cdef char **cpatharray
- cdef int i
- cdef int size
- size = len(path_element_list)
- cpatharray = <char **>malloc(sizeof(char*) * (size + 1))
-
- for i from 0 <= i < size:
- path_element = path_element_list[i]
- cpatharray[i] = path_element
-
- cpatharray[size] = NULL
-
- self._parsed_path = cpatharray
-
def get_base_service(self):
return bus_get_base_service(self)
@@ -343,8 +323,5 @@
_user_data_references.append(user_data)
- path_element_list = path[1:].split('/')
- self._build_parsed_path(path_element_list)
-
- return dbus_connection_register_object_path(self.conn, self._parsed_path, &cvtable,
+ return dbus_connection_register_object_path(self.conn, path, &cvtable,
<void*>user_data)
@@ -359,8 +336,5 @@
_user_data_references.append(user_data)
- path_element_list = path[1:].split('/')
- self._build_parsed_path(path_element_list)
-
- return dbus_connection_register_fallback(self.conn, self._parsed_path, &cvtable,
+ return dbus_connection_register_fallback(self.conn, path, &cvtable,
<void*>user_data)
@@ -371,8 +345,5 @@
cdef dbus_bool_t retval
- path_element_list = parent_path[1:].split('/')
- self._build_parsed_path(path_element_list)
-
- retval = dbus_connection_list_registered(self.conn, self._parsed_path, &cchild_entries)
+ retval = dbus_connection_list_registered(self.conn, parent_path, &cchild_entries)
if (not retval):
More information about the dbus-commit
mailing list