summaryrefslogtreecommitdiffstats
path: root/python
diff options
context:
space:
mode:
authorJohn (J5) Palmieri <johnp@redhat.com>2004-12-23 00:50:37 +0000
committerJohn (J5) Palmieri <johnp@redhat.com>2004-12-23 00:50:37 +0000
commitf06f148871c42ca76c7f7471ca7d0acb66fce8c4 (patch)
tree5a23985442da5cf2d2a47b9c0ddc9bcbc7b9fb85 /python
parentdbd4279a80fa72ed2b6cc0f2646a381007fd2180 (diff)
* patch from Rob Taylor <robtaylor@fastmail.fm>
- wrap bus_get_unix_user method in low level bindings - add get_unix_user method to the Bus class - fix extract.py so it can handle unsigned long return types
Diffstat (limited to 'python')
-rw-r--r--python/dbus.py4
-rw-r--r--python/dbus_bindings.pyx.in13
-rw-r--r--python/extract.py3
3 files changed, 18 insertions, 2 deletions
diff --git a/python/dbus.py b/python/dbus.py
index 4b538970..c8ac561a 100644
--- a/python/dbus.py
+++ b/python/dbus.py
@@ -99,6 +99,10 @@ class Bus:
def get_connection(self):
"""Get the dbus_bindings.Connection object associated with this Bus"""
return self._connection
+
+ def get_unix_user(self, service_name):
+ """Get the unix user for the given service_name on this Bus"""
+ return dbus_bindings.bus_get_unix_user(self._connection, service_name)
def _get_match_rule(self, signal_name, interface, service, path):
match_rule = "type='signal'"
diff --git a/python/dbus_bindings.pyx.in b/python/dbus_bindings.pyx.in
index 64b43a6d..59c38586 100644
--- a/python/dbus_bindings.pyx.in
+++ b/python/dbus_bindings.pyx.in
@@ -1132,6 +1132,19 @@ def bus_get_base_service(Connection connection):
conn = connection._get_conn()
return dbus_bus_get_base_service(conn)
+def bus_get_unix_user(Connection connection, service_name):
+ cdef DBusError error
+ dbus_error_init(&error)
+ cdef int retval
+ cdef DBusConnection *conn
+
+ conn = connection._get_conn()
+ retval = dbus_bus_get_unix_user(conn, service_name, &error)
+
+ if dbus_error_is_set(&error):
+ raise DBusException, error.message
+ return retval
+
def bus_register(Connection connection):
cdef DBusError error
dbus_error_init(&error)
diff --git a/python/extract.py b/python/extract.py
index 460af5ab..f836edc7 100644
--- a/python/extract.py
+++ b/python/extract.py
@@ -108,7 +108,7 @@ def find_typedefs(buf):
return typedefs
proto_pat = re.compile(r"""
-(?P<ret>(-|\w|\&|\*)+\s*) # return type
+(?P<ret>(-|\w|\&|\*|\s)+\s*) # return type
\s+ # skip whitespace
(?P<func>\w+)\s*[(] # match the function name until the opening (
(?P<args>.*?)[)] # group the function arguments
@@ -123,7 +123,6 @@ def find_functions(buf):
for p in buf:
if len(p) == 0:
continue
-
m = proto_pat.match(p)
if m == None:
continue