-
Notifications
You must be signed in to change notification settings - Fork 2
/
chirpwx.py
executable file
·57 lines (45 loc) · 1.5 KB
/
chirpwx.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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#!/usr/bin/env python3
import argparse
import collections
import functools
import gettext
import logging
import os
import sys
import wx
import wx.aui
import wx.grid
import wx.lib.newevent
from chirp import chirp_common
from chirp.drivers import ic2820, generic_csv
from chirp import directory
from chirp import logger
from chirp.wxui import main
if __name__ == '__main__':
gettext.install('CHIRP')
parser = argparse.ArgumentParser()
parser.add_argument("files", metavar="file", nargs='*',
help="File to open")
parser.add_argument("--module", metavar="module",
help="Load module on startup")
logger.add_version_argument(parser)
parser.add_argument("--profile", action="store_true",
help="Enable profiling")
parser.add_argument("--onlydriver", nargs="+",
help="Include this driver while loading")
parser.add_argument("--inspect", action="store_true",
help="Show wxPython inspector")
logger.add_arguments(parser)
args = parser.parse_args()
logger.handle_options(args)
directory.safe_import_drivers(limit=args.onlydriver)
#logging.basicConfig(level=logging.DEBUG)
app = wx.App()
mainwindow = main.ChirpMain(None, title='CHIRP')
mainwindow.Show()
for fn in args.files:
mainwindow.open_file(fn, select=False)
if args.inspect:
import wx.lib.inspection
wx.lib.inspection.InspectionTool().Show()
app.MainLoop()