Source code for promod3.core.helper
"""
Uncategorised functions which may come handy at several places.
"""
import sys
import ost
[docs]def MsgErrorAndExit(msg, exit_status):
'''
Send a messages to the |ost_s| :ost_docs:`error log <base/logging/>` and exit
the Python interpreter.
:param msg: The message.
:type msg: :class:`str`
:param exit_status: Exit code, ends up in ``$?`` in the shell. ``0`` is
traditionally reserved to successful commands.
:type exit_status: :class:`int`
:returns: No return value, exits script with value ``exit_status``.
'''
ost.LogError(msg)
sys.exit(exit_status)
__all__ = (
'MsgErrorAndExit',
)