logdif.py: use single key to stop or continue

Change-Id: I53b3254074eda7491dd16bbc39168960b0980e39
This commit is contained in:
zolliker 2025-04-24 11:24:46 +02:00
parent eb8eee02d1
commit aff6a2381a

View File

@ -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()