CLI: Explicitely wait for user interrupt (-k) and flush stdout each line.
--- a/Beremiz_cli.py Sun Jul 17 17:49:34 2022 +0200
+++ b/Beremiz_cli.py Sun Jul 17 18:07:46 2022 +0200
@@ -4,6 +4,7 @@
import os
import posixpath
import sys
+import time
from functools import wraps
import click
@@ -105,6 +106,11 @@
session.controller.finish()
+ if session.keep:
+ click.echo("Press Ctrl+C to quit")
+ while True:
+ time.sleep(1)
+
return ret
if __name__ == '__main__':
--- a/CLIController.py Sun Jul 17 17:49:34 2022 +0200
+++ b/CLIController.py Sun Jul 17 18:07:46 2022 +0200
@@ -22,6 +22,7 @@
if self.crlfpending:
sys.stdout.write("\n")
sys.stdout.write(s)
+ sys.stdout.flush()
self.crlfpending = 0
def write_error(self, s):