From f68e8c501cb7499949e9ac7c251f6dcb807c0aa6 Mon Sep 17 00:00:00 2001 From: DJ2LS <75909252+DJ2LS@users.noreply.github.com> Date: Thu, 13 May 2021 17:11:26 +0200 Subject: [PATCH] fixed issue #43 #43 fixed by changing the module loading order --- main.py | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/main.py b/main.py index 51479058..38aaf007 100644 --- a/main.py +++ b/main.py @@ -10,6 +10,8 @@ Created on Tue Dec 22 16:58:45 2020 import argparse import threading +import static + if __name__ == '__main__': @@ -20,21 +22,22 @@ if __name__ == '__main__': PARSER.add_argument('--rx', dest="audio_input_device", default=0, help="listening sound card", type=int) PARSER.add_argument('--tx', dest="audio_output_device", default=0, help="transmitting sound card", type=int) PARSER.add_argument('--port', dest="socket_port", default=3000, help="Socket port", type=int) - PARSER.add_argument('--deviceport', dest="hamlib_device_port", default="/dev/ttyUSB", help="Socket port", type=str) - PARSER.add_argument('--deviceid', dest="hamlib_device_id", default=311, help="Socket port", type=int) + PARSER.add_argument('--deviceport', dest="hamlib_device_port", default="/dev/ttyUSB0", help="Socket port", type=str) + PARSER.add_argument('--deviceid', dest="hamlib_device_id", default=3011, help="Socket port", type=int) ARGS = PARSER.parse_args() - # we need to wait until we got all parameters from argparse first - import static - import sock - import helpers - static.AUDIO_INPUT_DEVICE = ARGS.audio_input_device static.AUDIO_OUTPUT_DEVICE = ARGS.audio_output_device static.PORT = ARGS.socket_port static.HAMLIB_DEVICE_ID = ARGS.hamlib_device_id static.HAMLIB_DEVICE_PORT = ARGS.hamlib_device_port + + # we need to wait until we got all parameters from argparse first before we can load the other modules + import sock + import helpers + + # config logging helpers.setup_logging()