--- a/Beremiz_cli.py Wed Oct 05 16:10:17 2022 +0200
+++ b/Beremiz_cli.py Wed Oct 05 20:15:28 2022 +0200
@@ -5,11 +5,11 @@
import posixpath
import sys
import time
+
from functools import wraps
+from importlib import import_module
import click
-from importlib import import_module
-
class CLISession(object):
def __init__(self, **kwargs):
@@ -104,12 +104,15 @@
click.echo("Command sequence aborted")
break
- session.controller.finish()
-
if session.keep:
click.echo("Press Ctrl+C to quit")
- while True:
- time.sleep(1)
+ try:
+ while True:
+ time.sleep(1)
+ except KeyboardInterrupt:
+ pass
+
+ session.controller.finish()
return ret