Massive refactoring for tasks system.
commit49f87ab30502f46fac2f288c71cb7ede6bc5a673
authorThomas Leonard <talex5@gmail.com>
Sun, 27 Jan 2008 19:59:49 +0000 (27 19:59 +0000)
committerThomas Leonard <talex5@gmail.com>
Sun, 27 Jan 2008 20:01:34 +0000 (27 20:01 +0000)
tree9e9eb9df6793f40f6c9e548e6f79f0620acf3a07
parent781db7dbb944b8d5ccef878a9ee4e7e2e4eb3811
Massive refactoring for tasks system.

Improved logging and exception handing for tasks.

Added Policy.solve_with_downloads(). If a solution is ready then it returns
right away. Otherwise, it downloads every feed used, resolving after each one
until there are no more downloads in progress. This replaces Autopolicy's
recalculate_with_dl with a tasks-based one.

Added Handler.wait_for_blocker(). This runs a GLib mainloop until a blocker
fires. Useful for integrating with non-Blocker aware code.

Made 'ready' a propery on Solver, not a return value.

Replaced Download.on_success callbacks with a Blocker.

Changes to many 'start' methods so that they actually
manage the whole process, not just the beginning. Renamed:
start_downloading_* -> download_*

Some do more complex workflows. e.g. the download_and_import_feed task handles
downloading the feed, downloading the keys, confirming the keys and importing
the feed.
12 files changed:
tests/testautopolicy.py
tests/testdownload.py
tests/testsolver.py
zeroinstall/0launch-gui/impl_list.py
zeroinstall/injector/autopolicy.py
zeroinstall/injector/cli.py
zeroinstall/injector/download.py
zeroinstall/injector/handler.py
zeroinstall/injector/iface_cache.py
zeroinstall/injector/policy.py
zeroinstall/injector/solver.py
zeroinstall/support/tasks.py