diff --git a/tmtcc.py b/tmtcc.py index c445a63..0b7fda1 100755 --- a/tmtcc.py +++ b/tmtcc.py @@ -2,10 +2,11 @@ import logging import sys import time -import traceback from pathlib import Path from typing import cast +from spacepackets.ecss import PusVerificator +from spacepackets.version import get_version as get_sp_version from spacepackets.ccsds import SPACE_PACKET_HEADER_SIZE from spacepackets.cfdp import ( ConditionCode, @@ -16,6 +17,8 @@ from spacepackets.cfdp import ( PduFactory, PduType, ) + +import tmtccmd from tmtccmd.logging import add_colorlog_console_logger from tmtccmd.cfdp import CfdpUserBase, TransactionId from tmtccmd.cfdp.defs import CfdpRequestType @@ -32,28 +35,6 @@ from tmtccmd.cfdp.user import ( FileSegmentRecvdParams, ) from tmtccmd.tc.handler import SendCbParams - -try: - import spacepackets -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) - -try: - import tmtccmd -except ImportError: - run_tmtc_commander = None - initialize_tmtc_commander = None - tb = traceback.format_exc() - print(tb) - print("Python tmtccmd submodule could not be imported") - sys.exit(1) - -from spacepackets.ecss import PusVerificator from tmtccmd import TcHandlerBase, BackendBase from tmtccmd.util import FileSeqCountProvider, PusFileSeqCountProvider from tmtccmd.fsfw.tmtc_printer import FsfwTmTcPrinter @@ -450,7 +431,7 @@ def setup_backend( def main(): # noqa C901: Complexity okay here. print(f"-- eive tmtc v{version('eive-tmtc')} --") - print(f"-- spacepackets v{spacepackets.__version__} --") + print(f"-- spacepackets v{get_sp_version()} --") add_colorlog_console_logger(_LOGGER) # TODO: -V CLI argument to enable this? _LOGGER.setLevel(_LOG_LEVEL)