16 |
import sys |
import sys |
17 |
|
|
18 |
from application import ThubanApplication |
from application import ThubanApplication |
19 |
|
import Thuban.version |
20 |
|
|
21 |
def main(): |
def main(): |
22 |
"""Instantiate the application object and run the application""" |
"""Instantiate the application object and run the application""" |
23 |
app = ThubanApplication(0) |
|
24 |
if len(sys.argv) > 1: |
if verify_versions(): |
25 |
app.OpenSession(sys.argv[1]) |
app = ThubanApplication(0) |
26 |
app.top.ShowSessionTree() |
if len(sys.argv) > 1: |
27 |
app.MainLoop() |
app.OpenSession(sys.argv[1]) |
28 |
|
sys.excepthook = app.ShowExceptionDialog |
29 |
|
app.MainLoop() |
30 |
|
sys.excepthook = sys.__excepthook__ |
31 |
|
|
32 |
|
|
33 |
|
def verify_versions(): |
34 |
|
"""Check some library versions. |
35 |
|
|
36 |
|
Print a message containing any libraries which are wrong. |
37 |
|
Return True if everything is OK, otherwise False. |
38 |
|
""" |
39 |
|
|
40 |
|
errors = Thuban.version.verify_versions() |
41 |
|
|
42 |
|
if len(errors) > 0: |
43 |
|
msg = " The following version errors were detected:" |
44 |
|
|
45 |
|
for e in errors: |
46 |
|
msg += "\n " + e |
47 |
|
|
48 |
|
# if use_msg_box: |
49 |
|
# # XXX: use a message box to display the errors |
50 |
|
# pass |
51 |
|
|
52 |
|
print "\n*******************************************************" |
53 |
|
print msg |
54 |
|
print "*******************************************************\n" |
55 |
|
|
56 |
|
return False |
57 |
|
|
58 |
|
return True |