Start development series 0.42.1-post
[zeroinstall/zeroinstall-rsl.git] / zeroinstall / 0launch-gui / 0launch-gui
blob8901a2481cabf0700ed4c36f32f11ab56dc369a5
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
5 from os.path import dirname
7 import gettext
8 import locale
9 from logging import warn
10 try:
11 locale.setlocale(locale.LC_ALL, '')
12 except locale.Error:
13 warn('Error setting locale (eg. Invalid locale)')
14 gettext.install('zero-install', unicode=True, names=['ngettext'])
16 # This is for pycentral on Debian-type systems. 0launch-gui is a symlink to the
17 # copy in the pycentral source directory. Python does a realpath() on this
18 # before adding the containing directory to sys.path, which means we don't see
19 # the .pyc files. If run as root, this also causes .pyc files to be created in
20 # the source directory, leaving a mess when the package is removed.
21 _mydir = dirname(__file__)
22 sys.path.insert(0, _mydir)
24 # Make sure we're using our bundled copy of Zero Install, not the system version
25 # (if different)
26 sys.path.insert(0, dirname(dirname(_mydir)))
28 import pygtk; pygtk.require('2.0')
29 from gtk import glade
30 glade.textdomain('zero-install')
32 import main
34 main.run_gui(sys.argv[1:])