Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion dronecan_gui_tool/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
from argparse import ArgumentParser
parser = ArgumentParser(description='DroneCAN GUI tool')

parser.add_argument("--version", action='store_true', help="show version info")
parser.add_argument("--debug", action='store_true', help="enable debugging")
parser.add_argument("--dsdl", help="path to custom DSDL")
parser.add_argument("--signing-passphrase", help="MAVLink2 signing passphrase", default=None)
Expand All @@ -41,6 +42,13 @@
logging.basicConfig(stream=sys.stderr, level=logging_level,
format='%(asctime)s %(levelname)s %(name)s %(message)s')

from .version import __version__
if args.version:
v = '.'.join(map(str, __version__))
print("DroneCAN GUI Tool is an application for DroneCAN bus management and diagnostics")
print(f"DroneCAN GUI Tool Version: {v}")
sys.exit(0)

log_file = tempfile.NamedTemporaryFile(mode='w', prefix='dronecan_gui_tool-', suffix='.log', delete=False)
file_handler = logging.FileHandler(log_file.name)
file_handler.setLevel(logging_level)
Expand Down Expand Up @@ -74,7 +82,6 @@
from PyQt5.QtGui import QKeySequence, QDesktopServices
from PyQt5.QtCore import QTimer, Qt, QUrl

from .version import __version__
from .setup_window import run_setup_window
from .active_data_type_detector import ActiveDataTypeDetector

Expand Down
Loading