Mercurial > libervia-backend
diff libervia/cli/loops.py @ 4270:0d7bb4df2343
Reformatted code base using black.
author | Goffi <goffi@goffi.org> |
---|---|
date | Wed, 19 Jun 2024 18:44:57 +0200 |
parents | 0f8ea0768a3b |
children |
line wrap: on
line diff
--- a/libervia/cli/loops.py Tue Jun 18 12:06:45 2024 +0200 +++ b/libervia/cli/loops.py Wed Jun 19 18:44:57 2024 +0200 @@ -23,8 +23,7 @@ from libervia.cli.constants import Const as C from libervia.frontends.tools import aio -log.basicConfig(level=log.WARNING, - format='[%(name)s] %(message)s') +log.basicConfig(level=log.WARNING, format="[%(name)s] %(message)s") USER_INTER_MSG = _("User interruption: good bye") @@ -37,7 +36,7 @@ def get_libervia_cli_loop(bridge_name): - if 'dbus' in bridge_name: + if "dbus" in bridge_name: import signal class LiberviaCLILoop: @@ -76,9 +75,11 @@ """ print("\r" + USER_INTER_MSG) self.quit(C.EXIT_USER_CANCELLED) + else: import signal from twisted.internet import asyncioreactor + asyncioreactor.install() from twisted.internet import reactor, defer @@ -105,6 +106,7 @@ await defer.Deferred.fromFuture(fut) except BaseException: import traceback + traceback.print_exc() libervia_cli.quit(1) @@ -136,7 +138,6 @@ self._exit_code = C.EXIT_USER_CANCELLED reactor.callFromThread(reactor.stop) - if bridge_name == "embedded": raise NotImplementedError # from sat.core import sat_main