Large-scale API cleanup
[zeroinstall/zeroinstall-afb.git] / zeroinstall / injector / autopolicy.py
blobbe4f341348695ba29ad5d38d4f92b031d9e6d7f0
1 """
2 A simple non-interactive policy.
4 This module provides a simple policy that will select, download and run a suitable set of
5 implementations. It is not interactive. This is the policy used when you run B{0launch -c}, and
6 is also the policy used to run the injector's GUI.
8 @deprecated: The interesting functionality has moved into the L{policy.Policy} base-class.
9 """
11 # Copyright (C) 2009, Thomas Leonard
12 # See the README file for details, or visit http://0install.net.
14 from zeroinstall import _
15 from logging import info
17 from zeroinstall.injector import policy
18 from zeroinstall.injector.handler import Handler
20 class AutoPolicy(policy.Policy):
21 def __init__(self, interface_uri, download_only = False, dry_run = False, src = False, handler = None, command = 'run'):
22 """@param handler: (new in 0.30) handler to use, or None to create a L{Handler}"""
23 assert download_only is False
24 handler = handler or Handler()
25 if dry_run:
26 info(_("Note: dry_run is deprecated. Pass it to the handler instead!"))
27 handler.dry_run = True
28 policy.Policy.__init__(self, interface_uri, handler, src = src, command = command)