check both imports

This commit is contained in:
Robin Müller 2021-10-06 18:19:23 +02:00
parent 726935f77b
commit ed7188e2ba
No known key found for this signature in database
GPG Key ID: 11D4952C8CCEF814

View File

@ -27,24 +27,36 @@ limitations under the License.
@author R. Mueller @author R. Mueller
""" """
import sys 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.hook_implementations import EiveHookObject
from config.version import __version__ from config.version import __version__
from config.definitions import PUS_APID from config.definitions import PUS_APID
from pus_tm.factory_hook import ccsds_tm_handler 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(): def main():