diff options
author | Robert McQueen <robot101@debian.org> | 2005-11-07 12:14:53 +0000 |
---|---|---|
committer | Robert McQueen <robot101@debian.org> | 2005-11-07 12:14:53 +0000 |
commit | 95f9771d6be677d3393aab60f0f56126fbb252a6 (patch) | |
tree | f6d4226a29aaff30f72b9599b38e2aa4327ac46f /python/dbus_bindings.pyx | |
parent | ac36149533cdf3131dec3f43a7e9ea1ee11937f5 (diff) |
2005-11-07 Robert McQueen <robot101@debian.org>
* python/_dbus.py: Add WeakReferenceDictionary cache of dbus.Bus
instances to stop madness of creating new instances representing
the same bus connection all the time, rendering any tracking of
match rules and bus names quite meaningless. Caught a bug where
the private argument to SessionBus() and friends was being passed
in as use_default_mainloop by mistake. Still some problems with
multiple dbus_binding.Connection instances representing the same
low-level connection (eg when you use both SessionBus() and
StarterBus() in same process), but it's a lot better now than it
was.
* python/dbus_bindings.pyx: Add constants with the return values
for bus_request_name().
* python/service.py: Store bus name instances in a per-dbus.Bus cache
and retrieve the same instances for the same name, so deletion can be
done with refcounting. Also now throws some kind of error if you
don't actually get the name you requested, unlike previously...
* test/python/test-client.py: Add tests for instance caching of buses
and bus name objects.
Diffstat (limited to 'python/dbus_bindings.pyx')
-rw-r--r-- | python/dbus_bindings.pyx | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/python/dbus_bindings.pyx b/python/dbus_bindings.pyx index a96a5adc..75e448ee 100644 --- a/python/dbus_bindings.pyx +++ b/python/dbus_bindings.pyx @@ -1748,8 +1748,13 @@ def bus_register(Connection connection): return retval -SERVICE_FLAG_PROHIBIT_REPLACEMENT = 0x1 -SERVICE_FLAG_REPLACE_EXISTING = 0x2 +NAME_FLAG_PROHIBIT_REPLACEMENT = 0x1 +NAME_FLAG_REPLACE_EXISTING = 0x2 + +REQUEST_NAME_REPLY_PRIMARY_OWNER = 1 +REQUEST_NAME_REPLY_IN_QUEUE = 2 +REQUEST_NAME_REPLY_EXISTS = 3 +REQUEST_NAME_REPLY_ALREADY_OWNER = 4 def bus_request_name(Connection connection, service_name, flags=0): cdef DBusError error |