boilerplate old_ui
This commit is contained in:
parent
d2c6c38d31
commit
810427c91d
|
@ -56,6 +56,7 @@ class Stopwatch:
|
||||||
screen: curses.window
|
screen: curses.window
|
||||||
next_line = 0
|
next_line = 0
|
||||||
enable_animation: bool
|
enable_animation: bool
|
||||||
|
old_ui: bool
|
||||||
animation: Animation
|
animation: Animation
|
||||||
|
|
||||||
BUFFER_LINE = '=' * 120
|
BUFFER_LINE = '=' * 120
|
||||||
|
@ -63,12 +64,13 @@ class Stopwatch:
|
||||||
COL1_Y = 44
|
COL1_Y = 44
|
||||||
COL2_Y = 90
|
COL2_Y = 90
|
||||||
|
|
||||||
def __init__(self, beep_at, enable_sound, screen: curses.window, enable_animation: bool) -> None:
|
def __init__(self, beep_at, enable_sound, screen: curses.window, enable_animation: bool, old_ui: bool) -> None:
|
||||||
self.screen = screen
|
self.screen = screen
|
||||||
self.screen.addstr(0, 0, self.BUFFER_LINE)
|
self.screen.addstr(0, 0, self.BUFFER_LINE)
|
||||||
self.next_line += 2
|
self.next_line += 2
|
||||||
self.start_time = datetime.datetime.now().replace(microsecond=0)
|
self.start_time = datetime.datetime.now().replace(microsecond=0)
|
||||||
self.enable_animation = enable_animation
|
self.enable_animation = enable_animation
|
||||||
|
self.old_ui = old_ui
|
||||||
if enable_sound:
|
if enable_sound:
|
||||||
self.enable_sound = enable_sound
|
self.enable_sound = enable_sound
|
||||||
if not beep_at <= 0:
|
if not beep_at <= 0:
|
||||||
|
@ -167,11 +169,15 @@ def main():
|
||||||
curses.noecho()
|
curses.noecho()
|
||||||
curses.cbreak()
|
curses.cbreak()
|
||||||
|
|
||||||
|
if args.legacy_ui:
|
||||||
|
eprint("Old UI not implemented.")
|
||||||
|
|
||||||
timer = Stopwatch(
|
timer = Stopwatch(
|
||||||
beep_at=args.beep[0],
|
beep_at=args.beep[0],
|
||||||
enable_sound=args.sound,
|
enable_sound=args.sound,
|
||||||
screen=stdscreen,
|
screen=stdscreen,
|
||||||
enable_animation= not args.no_animation
|
enable_animation= not args.no_animation,
|
||||||
|
old_ui=args.legacy_ui
|
||||||
)
|
)
|
||||||
timer.display()
|
timer.display()
|
||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
|
|
Loading…
Reference in New Issue