some fixes for new version
EIVE/-/pipeline/head This commit looks good Details

This commit is contained in:
Robin Müller 2023-09-12 13:03:54 +02:00
parent c3b0470aa6
commit acbcbbe98f
Signed by: muellerr
GPG Key ID: A649FB78196E3849
1 changed files with 5 additions and 24 deletions

View File

@ -2,10 +2,11 @@
import logging import logging
import sys import sys
import time import time
import traceback
from pathlib import Path from pathlib import Path
from typing import cast 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.ccsds import SPACE_PACKET_HEADER_SIZE
from spacepackets.cfdp import ( from spacepackets.cfdp import (
ConditionCode, ConditionCode,
@ -16,6 +17,8 @@ from spacepackets.cfdp import (
PduFactory, PduFactory,
PduType, PduType,
) )
import tmtccmd
from tmtccmd.logging import add_colorlog_console_logger from tmtccmd.logging import add_colorlog_console_logger
from tmtccmd.cfdp import CfdpUserBase, TransactionId from tmtccmd.cfdp import CfdpUserBase, TransactionId
from tmtccmd.cfdp.defs import CfdpRequestType from tmtccmd.cfdp.defs import CfdpRequestType
@ -32,28 +35,6 @@ from tmtccmd.cfdp.user import (
FileSegmentRecvdParams, FileSegmentRecvdParams,
) )
from tmtccmd.tc.handler import SendCbParams 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 import TcHandlerBase, BackendBase
from tmtccmd.util import FileSeqCountProvider, PusFileSeqCountProvider from tmtccmd.util import FileSeqCountProvider, PusFileSeqCountProvider
from tmtccmd.fsfw.tmtc_printer import FsfwTmTcPrinter from tmtccmd.fsfw.tmtc_printer import FsfwTmTcPrinter
@ -450,7 +431,7 @@ def setup_backend(
def main(): # noqa C901: Complexity okay here. def main(): # noqa C901: Complexity okay here.
print(f"-- eive tmtc v{version('eive-tmtc')} --") 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) add_colorlog_console_logger(_LOGGER)
# TODO: -V CLI argument to enable this? # TODO: -V CLI argument to enable this?
_LOGGER.setLevel(_LOG_LEVEL) _LOGGER.setLevel(_LOG_LEVEL)