1 |
bh |
6 |
#! /usr/bin/python |
2 |
bh |
1520 |
# Copyright (C) 2001, 2002, 2003 by Intevation GmbH |
3 |
bh |
6 |
# 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 |
bh |
1520 |
from application import ThubanApplication |
19 |
jonathan |
1308 |
import Thuban.version |
20 |
bh |
6 |
|
21 |
|
|
def main(): |
22 |
|
|
"""Instantiate the application object and run the application""" |
23 |
jonathan |
540 |
|
24 |
|
|
if verify_versions(): |
25 |
|
|
app = ThubanApplication(0) |
26 |
|
|
if len(sys.argv) > 1: |
27 |
|
|
app.OpenSession(sys.argv[1]) |
28 |
|
|
app.MainLoop() |
29 |
jonathan |
1505 |
# sys.excepthook is set in ThubanApplication.OnInit() |
30 |
jonathan |
1392 |
sys.excepthook = sys.__excepthook__ |
31 |
jonathan |
540 |
|
32 |
|
|
def verify_versions(): |
33 |
|
|
"""Check some library versions. |
34 |
|
|
|
35 |
|
|
Print a message containing any libraries which are wrong. |
36 |
|
|
Return True if everything is OK, otherwise False. |
37 |
|
|
""" |
38 |
|
|
|
39 |
jonathan |
1308 |
errors = Thuban.version.verify_versions() |
40 |
jonathan |
540 |
|
41 |
|
|
if len(errors) > 0: |
42 |
|
|
msg = " The following version errors were detected:" |
43 |
|
|
|
44 |
|
|
for e in errors: |
45 |
|
|
msg += "\n " + e |
46 |
|
|
|
47 |
|
|
# if use_msg_box: |
48 |
|
|
# # XXX: use a message box to display the errors |
49 |
|
|
# pass |
50 |
|
|
|
51 |
|
|
print "\n*******************************************************" |
52 |
|
|
print msg |
53 |
|
|
print "*******************************************************\n" |
54 |
|
|
|
55 |
|
|
return False |
56 |
|
|
|
57 |
|
|
return True |