dbus/python dbus_bindings.pyx,1.17,1.18 service.py,1.20,1.21

Robert McQueen robot101 at freedesktop.org
Sun Nov 27 08:40:59 PST 2005


Update of /cvs/dbus/dbus/python
In directory gabe:/tmp/cvs-serv16946/python

Modified Files:
	dbus_bindings.pyx service.py 
Log Message:
2005-11-27  Robert McQueen  <robot101 at debian.org>

	* python/dbus_bindings.pyx: Fix a bug where doing a strict append
	with type v of an instance of dbus.Variant(foo, type='x') caused
	it to be boxed twice before sending over the bus.

	* python/dbus_bindings.pyx, python/service.py,
	test/python/test-client.py: Update the constants for the new
	request_name flags, and update comments/test cases now that queueing
	is the default action.

Index: dbus_bindings.pyx
===================================================================
RCS file: /cvs/dbus/dbus/python/dbus_bindings.pyx,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- dbus_bindings.pyx	15 Nov 2005 17:19:19 -0000	1.17
+++ dbus_bindings.pyx	27 Nov 2005 16:40:57 -0000	1.18
@@ -1053,7 +1053,10 @@
             tmp_sig = sig[1:-1]
             retval = self.append_struct(value, signature = tmp_sig)
         elif sig_type == TYPE_VARIANT:
-            retval = self.append_variant(Variant(value))
+            if isinstance(value, Variant):
+                retval = self.append_variant(value)
+            else:
+                retval = self.append_variant(Variant(value))
         elif sig_type == DICT_ENTRY_BEGIN:
             raise TypeError, "Signiture is invalid in append_strict. A dict entry must be part of an array." 
         else:
@@ -1748,8 +1751,9 @@
 
     return retval
 
-NAME_FLAG_PROHIBIT_REPLACEMENT = 0x1
+NAME_FLAG_ALLOW_REPLACEMENT    = 0x1
 NAME_FLAG_REPLACE_EXISTING     = 0x2
+NAME_FLAG_DO_NOT_QUEUE         = 0x4
 
 REQUEST_NAME_REPLY_PRIMARY_OWNER = 1
 REQUEST_NAME_REPLY_IN_QUEUE      = 2

Index: service.py
===================================================================
RCS file: /cvs/dbus/dbus/python/service.py,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -d -r1.20 -r1.21
--- service.py	15 Nov 2005 17:19:19 -0000	1.20
+++ service.py	27 Nov 2005 16:40:57 -0000	1.21
@@ -27,8 +27,9 @@
         if retval == dbus_bindings.REQUEST_NAME_REPLY_PRIMARY_OWNER:
             pass
         elif retval == dbus_bindings.REQUEST_NAME_REPLY_IN_QUEUE:
-            # you can't arrive at this state via the high-level bindings
-            # because you can't put flags in, but... who knows?
+            # queueing can happen by default, maybe we should
+            # track this better or let the user know if they're
+            # queued or not?
             pass
         elif retval == dbus_bindings.REQUEST_NAME_REPLY_EXISTS:
             raise NameExistsException(name)



More information about the dbus-commit mailing list