summaryrefslogtreecommitdiff
path: root/dbus/service.py
diff options
context:
space:
mode:
authorSimon McVittie <smcv@celebrin.pseudorandom.co.uk>2006-11-14 15:48:47 +0000
committerSimon McVittie <smcv@celebrin.pseudorandom.co.uk>2006-11-14 15:48:47 +0000
commit6008b37253f7a04b563b28a2aa9357de8cfd29d1 (patch)
tree3b8a476032f1d8a8aa6a55c426a37520b5de7cab /dbus/service.py
parent21b10a103d91651d9ac55d2d22832a5df251f45e (diff)
- dbus.service.Object, dbus.decorators.method: Allow utf8_strings and
byte_arrays parameters kwargs when exporting a method. These change the calling convention in the same way as Message.get_args_list(). - dbus.proxies.ProxyMethod: allow the same kwargs to be passed to any proxy method; this time, they change the representation of the remote method's return value(s). - Test that the above work - Improve correctness of setting the NAME_FLAG_* flags - Whitespace tweaks (remove hard tabs)
Diffstat (limited to 'dbus/service.py')
-rw-r--r--dbus/service.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/dbus/service.py b/dbus/service.py
index 0037cad..85da25c 100644
--- a/dbus/service.py
+++ b/dbus/service.py
@@ -101,11 +101,11 @@ class BusName(object):
return bus._bus_names[name]
# otherwise register the name
- name_flags = \
- _dbus_bindings.NAME_FLAG_ALLOW_REPLACEMENT * allow_replacement + \
- _dbus_bindings.NAME_FLAG_REPLACE_EXISTING * replace_existing + \
- _dbus_bindings.NAME_FLAG_DO_NOT_QUEUE * do_not_queue
-
+ name_flags = (
+ (allow_replacement and _dbus_bindings.NAME_FLAG_ALLOW_REPLACEMENT or 0) |
+ (replace_existing and _dbus_bindings.NAME_FLAG_REPLACE_EXISTING or 0) |
+ (do_not_queue and _dbus_bindings.NAME_FLAG_DO_NOT_QUEUE or 0))
+
retval = bus.request_name(name, name_flags)
# TODO: more intelligent tracking of bus name states?
@@ -363,7 +363,7 @@ class Object(Interface):
The D-Bus object path at which to export this Object.
"""
self._object_path = object_path
- self._name = bus_name
+ self._name = bus_name
self._bus = bus_name.get_bus()
self._connection = self._bus.get_connection()
@@ -381,7 +381,7 @@ class Object(Interface):
(candidate_method, parent_method) = _method_lookup(self, method_name, interface_name)
# set up method call parameters
- args = message.get_args_list()
+ args = message.get_args_list(**parent_method._dbus_get_args_options)
keywords = {}
if parent_method._dbus_out_signature is not None: