2021-02-11 23:18:12 +01:00
|
|
|
import sys
|
2020-09-02 00:08:06 +02:00
|
|
|
from tuxbot import ExitCodes
|
2021-01-27 15:14:05 +01:00
|
|
|
from tuxbot.core.utils.console import console
|
2020-06-03 19:41:30 +02:00
|
|
|
|
|
|
|
|
2020-10-22 00:00:48 +02:00
|
|
|
def main() -> None:
|
2020-06-03 19:41:30 +02:00
|
|
|
try:
|
2020-10-19 00:20:58 +02:00
|
|
|
from .__run__ import run # pylint: disable=import-outside-toplevel
|
2020-06-03 19:41:30 +02:00
|
|
|
|
2020-09-02 00:08:06 +02:00
|
|
|
run()
|
2020-06-03 19:41:30 +02:00
|
|
|
except SystemExit as exc:
|
2020-09-02 00:08:06 +02:00
|
|
|
if exc.code == ExitCodes.RESTART:
|
2021-02-11 23:18:12 +01:00
|
|
|
sys.exit(exc.code)
|
2020-09-02 00:08:06 +02:00
|
|
|
else:
|
|
|
|
raise exc
|
|
|
|
except Exception:
|
2021-04-20 15:43:20 +02:00
|
|
|
console.print_exception(
|
|
|
|
show_locals=True, word_wrap=True, extra_lines=5
|
|
|
|
)
|
2020-06-03 19:41:30 +02:00
|
|
|
|
|
|
|
|
|
|
|
if __name__ == "__main__":
|
2020-08-28 01:06:57 +02:00
|
|
|
try:
|
|
|
|
main()
|
|
|
|
except Exception:
|
2021-04-20 15:43:20 +02:00
|
|
|
console.print_exception(
|
|
|
|
show_locals=True, word_wrap=True, extra_lines=5
|
|
|
|
)
|