1 |
#! /usr/bin/python |
# Copyright (C) 2001, 2002, 2003 by Intevation GmbH |
|
# Copyright (C) 2001, 2002 by Intevation GmbH |
|
2 |
# Authors: |
# Authors: |
3 |
# Jan-Oliver Wagner <[email protected]> |
# Jan-Oliver Wagner <[email protected]> |
4 |
# Bernhard Herzog <[email protected]> |
# Bernhard Herzog <[email protected]> |
13 |
__version__ = "$Revision$" |
__version__ = "$Revision$" |
14 |
|
|
15 |
import sys |
import sys |
16 |
|
import getopt |
17 |
|
|
18 |
from application import ThubanApplication |
import application |
19 |
import Thuban.version |
import Thuban.version |
20 |
|
|
21 |
|
|
22 |
|
class options: |
23 |
|
|
24 |
|
attribute_editing_enabled = False |
25 |
|
|
26 |
|
|
27 |
def main(): |
def main(): |
28 |
"""Instantiate the application object and run the application""" |
"""Instantiate the application object and run the application""" |
29 |
|
|
30 |
if verify_versions(): |
if verify_versions(): |
31 |
app = ThubanApplication(0) |
app = application.ThubanApplication(0) |
32 |
if len(sys.argv) > 1: |
opts, args = getopt.getopt(sys.argv[1:], '', |
33 |
app.OpenSession(sys.argv[1]) |
['enable-attribute-editing']) |
34 |
sys.excepthook = app.ShowExceptionDialog |
for optchar, value in opts: |
35 |
|
if optchar == '--enable-attribute-editing': |
36 |
|
options.attribute_editing_enabled = True |
37 |
|
else: |
38 |
|
print >>sys.stderr, "Unknown option", optchar |
39 |
|
|
40 |
|
# If there was a non-flag argument it's the name of a thuban |
41 |
|
# file. |
42 |
|
if args: |
43 |
|
app.OpenSession(args[0]) |
44 |
|
|
45 |
app.MainLoop() |
app.MainLoop() |
46 |
|
# sys.excepthook is set in ThubanApplication.OnInit() |
47 |
sys.excepthook = sys.__excepthook__ |
sys.excepthook = sys.__excepthook__ |
48 |
|
|
49 |
|
|