mirror of
https://github.com/kk7ds/chirp.git
synced 2024-09-21 10:37:15 +00:00
b737efff2b
Our custom cpep8 thing for drivers is mostly legacy and used because we don't have compliance across all the drivers. For wxui, we should enforce flake8 compliance from the start. This makes our style target do that and fixes up all the current complaints.
56 lines
1.5 KiB
Python
Executable File
56 lines
1.5 KiB
Python
Executable File
#!/usr/bin/env python3
|
|
|
|
import argparse
|
|
import gettext
|
|
|
|
import wx
|
|
import wx.aui
|
|
import wx.grid
|
|
import wx.lib.newevent
|
|
|
|
from chirp import directory
|
|
from chirp import logger
|
|
|
|
from chirp.ui import config
|
|
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)
|
|
|
|
CONF = config.get()
|
|
if CONF.get('developer', 'state'):
|
|
from chirp.drivers import fake
|
|
directory.register(fake.FakeLiveRadio)
|
|
directory.register(fake.FakeLiveSlowRadio)
|
|
|
|
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()
|