1 |
#! /usr/bin/python |
2 |
# Copyright (C) 2001 by Intevation GmbH |
3 |
# Authors: |
4 |
# Jan-Oliver Wagner <[email protected]> |
5 |
# Bernhard Herzog <[email protected]> |
6 |
# |
7 |
# This program is free software under the GPL (>=v2) |
8 |
# Read the file COPYING coming with Thuban for details. |
9 |
|
10 |
""" |
11 |
The main entry point for the Thuban GUI. |
12 |
""" |
13 |
|
14 |
__version__ = "$Revision$" |
15 |
|
16 |
import sys |
17 |
|
18 |
# import wxPython.wx here to get the side effects of the wxPython |
19 |
# import, especially setting the locale to the user's defaults throught |
20 |
# GTK. We then set the locale again to the user's defaults, but this |
21 |
# time we're going through the standard python locale module, so all the |
22 |
# magic necessary to make python work properly is done. Without this, |
23 |
# something harmless like float("1.2") may fail when run under a non-C |
24 |
# locale like de_DE |
25 |
import wxPython.wx |
26 |
try: |
27 |
import locale |
28 |
locale.setlocale(locale.LC_ALL, "") |
29 |
except ImportError: |
30 |
# the locale module may not be available on some systems |
31 |
pass |
32 |
|
33 |
from application import ThubanApplication |
34 |
|
35 |
def main(): |
36 |
"""Instantiate the application object and run the application""" |
37 |
global app |
38 |
app = ThubanApplication(0) |
39 |
if len(sys.argv) > 1: |
40 |
app.OpenSession(sys.argv[1]) |
41 |
app.MainLoop() |