From 0230641b1d65afdece8663a02440a08e9a524841 Mon Sep 17 00:00:00 2001 From: Markus Zolliker Date: Thu, 24 Apr 2025 11:24:46 +0200 Subject: [PATCH] logdif.py: use single key to stop or continue Change-Id: I53b3254074eda7491dd16bbc39168960b0980e39 --- logdif.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/logdif.py b/logdif.py index e42f5b8..876fb8e 100644 --- a/logdif.py +++ b/logdif.py @@ -5,6 +5,7 @@ which should be in the branch where logdif.py is running """ import sys +from readchar import readchar from subprocess import check_output branches = sys.argv[1:3] @@ -91,12 +92,13 @@ def print_commit(line): output.append(f'{no:3}:{iline[0]}') iline[1] = '' # clear title else: - output.append(' ' * 11) + output.append(' ' * 12) if visible: print(' '.join(output), title) cnt[0] += 1 if cnt[0] % 50 == 0: - if input(f' {br0:11s} {br1:11s}--- press any letter to continue, return to stop ---') == '': + print(f' {br0:12s} {br1:12s}--- press any letter to continue, return to stop ---') + if readchar() in 'q\n': raise StopIteration()