Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
source
TMTC COMMANDER CORE
Commits
483cec7f
Commit
483cec7f
authored
Feb 21, 2021
by
Robin Mueller
Browse files
better error checking
parent
f6653aa9
Changes
1
Hide whitespace changes
Inline
Side-by-side
tmtcc_runner.py
View file @
483cec7f
...
...
@@ -66,7 +66,15 @@ def assign_tmtc_commander_hooks(hook_object: TmTcHookBase):
from
tmtc_core.core.definitions
import
CoreGlobalIds
if
hook_object
is
None
:
logger
.
error
(
"Passed hook base object handle is invalid! Terminating.."
)
logger
.
error
(
"Passed hook base object handle is invalid. Terminating.."
)
sys
.
exit
(
-
1
)
# Check whether all required hook functions have bee implemented properly, Python
# does not enforce this.
if
hook_object
.
get_version
is
None
or
hook_object
.
add_globals_pre_args_parsing
is
None
\
or
hook_object
.
add_globals_post_args_parsing
is
None
:
logger
.
error
(
"Passed hook base object handle is invalid. "
"Abstract functions have to be implemented!"
)
sys
.
exit
(
-
1
)
# Insert hook object handle into global dictionary so it can be used by the TMTC commander
update_global
(
CoreGlobalIds
.
TMTC_HOOK
,
hook_object
)
...
...
@@ -84,8 +92,9 @@ def set_up_tmtc_commander(use_gui: bool, reduced_printout: bool):
# of the commander core.
hook_obj_raw
=
get_global
(
CoreGlobalIds
.
TMTC_HOOK
)
if
hook_obj_raw
is
None
:
logger
.
info
(
"No valid hook object found. Please make sure to implement it, instantiate it "
"and pass it via the assign_tmtc_commander_hooks function!"
)
logger
.
info
(
"No valid hook object found. "
"initialize_tmtc_commander needs to be called first. Terminating.."
)
sys
.
exit
(
-
1
)
hook_obj
=
cast
(
TmTcHookBase
,
hook_obj_raw
)
if
not
reduced_printout
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment