-
Notifications
You must be signed in to change notification settings - Fork 4
/
wxEditor.py
31 lines (23 loc) · 1.07 KB
/
wxEditor.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import argparse
import wx
import tests.TestAugmenter
import tests.TestPlugin
from asn1editor import WxPythonMainWindow
if __name__ == "__main__":
parser = argparse.ArgumentParser(description='ASN.1 editor')
parser.add_argument('asn1spec', nargs='?', help='ASN.1 specification file name')
parser.add_argument('-type', required=False, help='Name of the ASN.1 type to load (Module name.Type name)')
parser.add_argument('-data', required=False, help='Data file to load')
parser.add_argument('-test', required=False, help='Activate test mode', action='store_true')
args = parser.parse_args()
app = wx.App()
if args.test:
frame = WxPythonMainWindow([tests.TestPlugin.TestPlugin(), tests.TestPlugin.TestPlugin(" 2")], tests.TestAugmenter.TestAugmenter('Help'))
else:
frame = WxPythonMainWindow(type_augmenter=tests.TestAugmenter.TestAugmenter(None))
if args.asn1spec is not None:
frame.load_spec(args.asn1spec, args.type)
if args.data is not None:
frame.load_data_from_file(args.data)
frame.Show()
app.MainLoop()