1

I started playing with aptdaemon on Ubuntu 13.10 recently, and I'm baffled. Calling simulate() on a transaction doesn't update the dependencies list. Debug from aptd shows that several events are being emitted, including a PropertyChanged event for Dependencies, but my handler is not called. Here's some code that demonstrates the problem:

import aptdaemon.client

def printcall(*args, **kwargs):
    print("call(*%r, **%r)" % (args, kwargs))

client = aptdaemon.client.AptClient()
# I have make installed, but not abiword.
txn = client.install_packages(["make", "abiword"])
txn.connect("dependencies-changed", printcall)
txn.simulate()

print(txn.dependencies)
print(txn.packages)

For me, it prints an empty dependencies list (actually, a single list containing 6 empty lists), whereas running apt-get install abiword from the command-line comes up with several dependencies. Also, the dependencies-changed event is never fired:

dbus.Struct((dbus.Array([], signature=dbus.Signature('s')), dbus.Array([], signature=dbus.Signature('s')), dbus.Array([], signature=dbus.Signature('s')), dbus.Array([], signature=dbus.Signature('s')), dbus.Array([], signature=dbus.Signature('s')), dbus.Array([], signature=dbus.Signature('s')), dbus.Array([], signature=dbus.Signature('s'))), signature=None, variant_level=1)
dbus.Struct((dbus.Array([dbus.String(u'make'), dbus.String(u'abiword')], signature=dbus.Signature('s')), dbus.Array([], signature=dbus.Signature('s')), dbus.Array([], signature=dbus.Signature('s')), dbus.Array([], signature=dbus.Signature('s')), dbus.Array([], signature=dbus.Signature('s')), dbus.Array([], signature=dbus.Signature('s'))), signature=None, variant_level=1)

Is this a bug, or am I missing something (like an event loop)?

Braiam
  • 66,947
  • 30
  • 177
  • 264
Gavin Panella
  • 806
  • 4
  • 8
  • If you want the event fired you need to use [AptTransaction](http://pythonhosted.org/aptdaemon/aptdaemon.client.html#aptdaemon.client.AptTransaction) instead, in the way `aptdaemon.client.AptTransaction(txn.tid)` – Braiam Jan 05 '14 at 03:47

0 Answers0