From 726935f77b6fdb8415932d545554f748b5ed1dbb Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 6 Oct 2021 18:00:34 +0200 Subject: [PATCH 1/4] set custom logger --- spacepackets | 2 +- tmtc_client_cli.py | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/spacepackets b/spacepackets index b5068ce..e441c50 160000 --- a/spacepackets +++ b/spacepackets @@ -1 +1 @@ -Subproject commit b5068ceb033b6a857d463d6d91aa8cbdf07913e9 +Subproject commit e441c50809cc18018c57aaf535549f9a2c0b9583 diff --git a/tmtc_client_cli.py b/tmtc_client_cli.py index 3fc7ded..c7cbf6d 100755 --- a/tmtc_client_cli.py +++ b/tmtc_client_cli.py @@ -35,7 +35,9 @@ from pus_tm.factory_hook import ccsds_tm_handler try: from tmtccmd.runner import initialize_tmtc_commander, run_tmtc_commander, add_ccsds_handler from tmtccmd.ccsds.handler import CcsdsTmHandler + from tmtccmd.utility.logger import TMTC_LOGGER_NAME import spacepackets + from spacepackets.log import set_custom_console_logger_name except ImportError as error: run_tmtc_commander = None initialize_tmtc_commander = None @@ -49,6 +51,7 @@ def main(): hook_obj = EiveHookObject() print(f'-- eive tmtc version {__version__} --') print(f'-- spacepackets version {spacepackets.__version__} --') + set_custom_console_logger_name(logger_name=TMTC_LOGGER_NAME) initialize_tmtc_commander(hook_object=hook_obj) ccsds_handler = CcsdsTmHandler() ccsds_handler.add_tm_handler(apid=PUS_APID, pus_tm_handler=ccsds_tm_handler, max_queue_len=50) From ed7188e2ba5d82ea65c68b735700b63c732e4691 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 6 Oct 2021 18:19:23 +0200 Subject: [PATCH 2/4] check both imports --- tmtc_client_cli.py | 38 +++++++++++++++++++++++++------------- 1 file changed, 25 insertions(+), 13 deletions(-) diff --git a/tmtc_client_cli.py b/tmtc_client_cli.py index c7cbf6d..ba29c2e 100755 --- a/tmtc_client_cli.py +++ b/tmtc_client_cli.py @@ -27,24 +27,36 @@ limitations under the License. @author R. Mueller """ import sys +try: + from tmtccmd.runner import initialize_tmtc_commander, run_tmtc_commander, add_ccsds_handler + from tmtccmd.ccsds.handler import CcsdsTmHandler + from tmtccmd.utility.logger import TMTC_LOGGER_NAME +except ImportError as error: + run_tmtc_commander = None + initialize_tmtc_commander = None + print(error) + print('Python tmtccmd submodule could not be imported') + print( + 'Install with \"cd tmtccmd && python3 -m pip ' + 'install -e .[gui]\" for interactive installation' + ) + sys.exit(1) + +try: + import spacepackets + from spacepackets.log import set_custom_console_logger_name +except ImportError as error: + print(error) + print('Python spacepackets module could not be imported') + print( + 'Install with \"cd spacepackets && python3 -m pip intall -e .\" for interative installation' + ) + sys.exit(1) from config.hook_implementations import EiveHookObject from config.version import __version__ from config.definitions import PUS_APID from pus_tm.factory_hook import ccsds_tm_handler -try: - from tmtccmd.runner import initialize_tmtc_commander, run_tmtc_commander, add_ccsds_handler - from tmtccmd.ccsds.handler import CcsdsTmHandler - from tmtccmd.utility.logger import TMTC_LOGGER_NAME - import spacepackets - from spacepackets.log import set_custom_console_logger_name -except ImportError as error: - run_tmtc_commander = None - initialize_tmtc_commander = None - print(error) - print("Python tmtccmd submodule could not be imported") - print("Install with \"cd tmtccmd && python3 -m pip install -e .\" for interactive installation") - sys.exit(0) def main(): From 56717935e6d90e8a501894f44cd250aec8d12d03 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Sat, 9 Oct 2021 13:24:57 +0200 Subject: [PATCH 3/4] spacepackets update --- spacepackets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spacepackets b/spacepackets index e441c50..d2b5dec 160000 --- a/spacepackets +++ b/spacepackets @@ -1 +1 @@ -Subproject commit e441c50809cc18018c57aaf535549f9a2c0b9583 +Subproject commit d2b5decaf7d0db44933e8911f4a0b1ae4f6d4eab From 7b49babb1febb3959f0f817aa4b4ce4c32d6d21c Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 11 Oct 2021 10:25:29 +0200 Subject: [PATCH 4/4] spacepackets update --- spacepackets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spacepackets b/spacepackets index d2b5dec..559e42f 160000 --- a/spacepackets +++ b/spacepackets @@ -1 +1 @@ -Subproject commit d2b5decaf7d0db44933e8911f4a0b1ae4f6d4eab +Subproject commit 559e42f03b51cfb673e46cd3b25e68348c33fc21