]> git.ipfire.org Git - thirdparty/dbus.git/commitdiff
2005-11-27 Robert McQueen <robot101@debian.org>
authorRobert McQueen <robot101@debian.org>
Sun, 27 Nov 2005 16:40:57 +0000 (16:40 +0000)
committerRobert McQueen <robot101@debian.org>
Sun, 27 Nov 2005 16:40:57 +0000 (16:40 +0000)
* 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.

ChangeLog
python/dbus_bindings.pyx
python/service.py
test/python/test-client.py

index 702784d3acb4714c43e7d418d6cb7ff41a58cd63..e3e878020c2549a8148ae6b11011e191a8ac1c83 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2005-11-27  Robert McQueen  <robot101@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.
+
 2005-11-22  John (J5) Palmieri  <johnp@redhat.com>
 
        * configure.in:
index 8b1b221bf40118baec860f990f1242fa1aa22a4c..21adc87a6a3a157d322b97656776f7203444defe 100644 (file)
@@ -1053,7 +1053,10 @@ cdef class MessageIter:
             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 @@ def bus_register(Connection connection):
 
     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 e5a7002babaf77f82982583a2388d91a90f7c73c..ad36e4f50ff9b6a49fd88918cc1c03aaa4d18e0a 100644 (file)
@@ -27,8 +27,9 @@ class BusName(object):
         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)
index e972f446a4900d3b87011250e3b8ae8f20b7c25c..230004007747284d222441116fa9d0b4bfabf0f5 100755 (executable)
@@ -227,8 +227,9 @@ class TestDBusBindings(unittest.TestCase):
         print '\n******** Testing BusName creation ********'
         test = [('org.freedesktop.DBus.Python.TestName', True),
                 ('org.freedesktop.DBus.Python.TestName', True),
-                ('org.freedesktop.DBus.Python.InvalidName&^*%$', False),
-                ('org.freedesktop.DBus.TestSuitePythonService', False)]
+                ('org.freedesktop.DBus.Python.InvalidName&^*%$', False)]
+        # Do some more intelligent handling/testing of queueing vs success?
+        # ('org.freedesktop.DBus.TestSuitePythonService', False)]
         # For some reason this actually succeeds
         # ('org.freedesktop.DBus', False)]