Release 2.1
[rox-edit/bju.git] / AppRun
blobb58fd454fa162646175a14dc6a34c5c6a64544a3
1 #!/usr/bin/env python
2 import setup
4 import sys
5 import rox
6 import EditWindow
8 try:
9 from optparse import OptionParser
10 except ImportError:
11 # optparse missing, e.g. in Python 2.2
12 line_number = None
13 args = sys.argv[1:]
14 else:
15 parser = OptionParser()
16 parser.add_option("-l", "--line_number", type='int',
17 dest="line_number", default=None,
18 help="start editor at given line number")
20 (options, args) = parser.parse_args()
21 line_number = options.line_number
23 if len(args):
24 for file in args:
25 try:
26 EditWindow.EditWindow(file, line_number = line_number)
27 except EditWindow.Abort:
28 pass
29 else:
30 EditWindow.EditWindow()
32 rox.mainloop()