mirror of
https://gitlab.freedesktop.org/dbus/dbus.git
synced 2026-02-15 08:00:36 +01:00
* s/Message(_create=0)/EmptyMessage everywhere else
* test/python/test-{server|client}.py: add the python/.libs directory
to the lookup path so dbus_bindings and dbus_glib_bindings don't
get picked up from the system
This commit is contained in:
parent
64e468d21c
commit
18170dd986
5 changed files with 17 additions and 7 deletions
|
|
@ -5,6 +5,11 @@
|
|||
to a Pyrex bug that fails to call __del__ when the Message object goes out
|
||||
of scope. For some reason subclassing Message fixes this bug
|
||||
(Bus::send_with_reply_and_block): use EmptyMessage instead of Message
|
||||
- s/Message(_create=0)/EmptyMessage everywhere else
|
||||
|
||||
* test/python/test-{server|client}.py: add the python/.libs directory
|
||||
to the lookup path so dbus_bindings and dbus_glib_bindings don't
|
||||
get picked up from the system
|
||||
|
||||
2005-08-25 Colin Walters <walters@verbum.org>
|
||||
|
||||
|
|
|
|||
|
|
@ -208,7 +208,10 @@ cdef DBusHandlerResult cmessage_function_handler (DBusConnection *connection,
|
|||
tup = <object>user_data
|
||||
assert (type(tup) == list)
|
||||
function = tup[0]
|
||||
message = Message(_create=0)
|
||||
message = EmptyMessage()
|
||||
|
||||
#we don't own the message so we need to ref it
|
||||
dbus_message_ref(msg)
|
||||
message._set_msg(msg)
|
||||
conn = Connection()
|
||||
conn.__cinit__(None, connection)
|
||||
|
|
@ -274,7 +277,7 @@ cdef class Connection:
|
|||
|
||||
def borrow_message(self):
|
||||
cdef Message m
|
||||
m = Message(_create=0)
|
||||
m = EmptyMessage()
|
||||
m._set_msg(dbus_connection_borrow_message(self.conn))
|
||||
return m
|
||||
|
||||
|
|
@ -295,7 +298,7 @@ cdef class Connection:
|
|||
|
||||
msg = dbus_connection_pop_message(self.conn)
|
||||
if msg != NULL:
|
||||
m = Message(_create=0)
|
||||
m = EmptyMessage()
|
||||
m._set_msg(msg)
|
||||
else:
|
||||
m = None
|
||||
|
|
@ -491,7 +494,7 @@ cdef void _pending_call_notification(DBusPendingCall *pending_call, void *user_d
|
|||
(reply_handler, error_handler) = <object>user_data
|
||||
|
||||
dbus_message = dbus_pending_call_steal_reply(pending_call)
|
||||
message = Message(_create=0)
|
||||
message = EmptyMessage()
|
||||
message._set_msg(dbus_message)
|
||||
|
||||
type = message.get_type()
|
||||
|
|
@ -542,7 +545,7 @@ cdef class PendingCall:
|
|||
|
||||
def get_reply(self):
|
||||
cdef Message message
|
||||
message = Message(_create=0)
|
||||
message = EmptyMessage()
|
||||
message._set_msg(dbus_pending_call_steal_reply(self.pending_call))
|
||||
return message
|
||||
|
||||
|
|
|
|||
|
|
@ -29,6 +29,6 @@ fi
|
|||
|
||||
ln -s $DBUS_TOP_BUILDDIR/python $DBUS_TOP_BUILDDIR/python/dbus
|
||||
echo "running test-client.py"
|
||||
$DBUS_TOP_BUILDDIR/test/python/test-client.py || die "test-client.py failed"
|
||||
libtool --mode=execute $DEBUG $DBUS_TOP_BUILDDIR/test/python/test-client.py || die "test-client.py failed"
|
||||
rm $DBUS_TOP_BUILDDIR/python/dbus
|
||||
|
||||
|
|
|
|||
|
|
@ -6,8 +6,10 @@ builddir = os.environ["DBUS_TOP_BUILDDIR"]
|
|||
pydir = builddir + "/python"
|
||||
|
||||
sys.path.insert(0, pydir)
|
||||
sys.path.insert(0, pydir + "/.libs")
|
||||
|
||||
import dbus
|
||||
import dbus_bindings
|
||||
|
||||
if not dbus.__file__.startswith(pydir):
|
||||
raise Exception("DBus modules are not being picked up from the package")
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ builddir = os.environ["DBUS_TOP_BUILDDIR"]
|
|||
pydir = builddir + "/python"
|
||||
|
||||
sys.path.insert(0, pydir)
|
||||
sys.path.insert(0, pydir + '/.libs')
|
||||
|
||||
import dbus
|
||||
|
||||
|
|
@ -29,6 +30,5 @@ class TestObject(dbus.service.Object):
|
|||
session_bus = dbus.SessionBus()
|
||||
name = dbus.service.BusName("org.freedesktop.DBus.TestSuitePythonService", bus=session_bus)
|
||||
object = TestObject(name)
|
||||
|
||||
loop = gobject.MainLoop()
|
||||
loop.run()
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue