Import _ into each module rather than using a builtin
[zeroinstall/zeroinstall-rsl.git] / zeroinstall / 0launch-gui / 0launch-gui
blobc48e100dcb98aa1c6a2e962eca174e1d782f49a9
1 #!/usr/bin/env python
2 # Copyright (C) 2009, Thomas Leonard
3 # See the README file for details, or visit http://0install.net.
4 import os, sys
6 import gettext
7 import locale
8 from logging import warn
9 try:
10 locale.setlocale(locale.LC_ALL, '')
11 except locale.Error:
12 warn('Error setting locale (eg. Invalid locale)')
13 gettext.install('zero-install', unicode=True, names=['ngettext'])
15 # This is for pycentral on Debian-type systems. 0launch-gui is a symlink to the
16 # copy in the pycentral source directory. Python does a realpath() on this
17 # before adding the containing directory to sys.path, which means we don't see
18 # the .pyc files. If run as root, this also causes .pyc files to be created in
19 # the source directory, leaving a mess when the package is removed.
20 sys.path.insert(0, os.path.dirname(__file__))
22 import pygtk; pygtk.require('2.0')
23 from gtk import glade
24 glade.textdomain('zero-install')
26 import main
28 main.run_gui(sys.argv[1:])