2 The Python implementation of the Zero Install injector is divided into four sub-packages:
4 - L{zeroinstall.injector} contains most of the interesting stuff for managing feeds, keys and downloads and for selecting versions
5 - L{zeroinstall.zerostore} contains low-level code for handling the implementation cache (where unpacked packages are stored)
6 - L{zeroinstall.gtkui} contains code for making GTK user-interfaces
7 - L{zeroinstall.support} contains helper code (not really specific to Zero Install)
9 @copyright: (C) 2009, Thomas Leonard
10 @see: U{http://0install.net}
12 @var _: a function for translating strings using the zero-install domain (for use internally by Zero Install)
18 from os
.path
import dirname
, join
22 translation
= gettext
.translation('zero-install', fallback
= False)
24 localedir
= join(dirname(dirname(__file__
)), 'locale')
25 translation
= gettext
.translation('zero-install',
26 localedir
= localedir
,
28 _
= translation
.ugettext
30 class SafeException(Exception):
31 """An exception that can be reported to the user without a stack trace.
32 The command-line interface's C{--verbose} option will display the full stack trace."""
34 class NeedDownload(SafeException
):
35 """Thrown by L{injector.autopolicy.AutoPolicy} if we tried to start a download
36 and downloading is disabled."""
37 def __init__(self
, url
):
38 Exception.__init
__(self
, _("Would download '%s'") % url
)