Removed unused force attribute
[zeroinstall/solver.git] / zeroinstall / __init__.py
blob16c379fa4adaba804368ff3357eeda9724e42873
1 """
2 The Python implementation of the Zero Install injector is divided into five sub-packages:
4 - L{zeroinstall.cmd} contains one module for each 0install sub-command (providing the shell-scripting interface)
5 - L{zeroinstall.injector} contains most of the interesting stuff for managing feeds, keys and downloads and for selecting versions
6 - L{zeroinstall.zerostore} contains low-level code for handling the implementation cache (where unpacked packages are stored)
7 - L{zeroinstall.gtkui} contains code for making GTK user-interfaces
8 - L{zeroinstall.support} contains helper code (not really specific to Zero Install)
10 @copyright: (C) 2011, Thomas Leonard
11 @see: U{http://0install.net}
13 @var _: a function for translating strings using the zero-install domain (for use internally by Zero Install)
14 """
16 version = '1.9'
18 import gobject; gobject.threads_init()
20 import gettext
21 from os.path import dirname, join
23 try:
24 localedir = None
25 translation = gettext.translation('zero-install', fallback = False)
26 except:
27 localedir = join(dirname(dirname(__file__)), 'share', 'locale')
28 translation = gettext.translation('zero-install',
29 localedir = localedir,
30 fallback = True)
31 try:
32 _ = translation.ugettext # Python 2
33 except AttributeError:
34 _ = translation.gettext # Python 3
36 class SafeException(Exception):
37 """An exception that can be reported to the user without a stack trace.
38 The command-line interface's C{--verbose} option will display the full stack trace."""
40 class NeedDownload(SafeException):
41 """Thrown if we tried to start a download and downloading is
42 disabled."""
43 def __init__(self, url):
44 Exception.__init__(self, _("Would download '%s'") % url)