Release 0.50
[zeroinstall.git] / zeroinstall / __init__.py
blobfac1585c031dd2445e5b6294fea5943bcca2fc0b
1 """
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) 2010, 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)
13 """
15 version = '0.50'
17 import gettext
18 from os.path import dirname, join
20 try:
21 localedir = None
22 translation = gettext.translation('zero-install', fallback = False)
23 except:
24 localedir = join(dirname(dirname(__file__)), 'locale')
25 translation = gettext.translation('zero-install',
26 localedir = localedir,
27 fallback = True)
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)