From f5e5db1908e0eeb553da6df6ab01463b880a36a8 Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Tue, 17 Aug 2021 13:46:47 -0700 Subject: [PATCH] Let hms use pipeable.input_many instead of go. --- voussoirkit/hms.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/voussoirkit/hms.py b/voussoirkit/hms.py index a25bf91..13bbd4c 100644 --- a/voussoirkit/hms.py +++ b/voussoirkit/hms.py @@ -1,6 +1,8 @@ import math import sys +from voussoirkit import pipeable + def hms_to_seconds(hms): ''' Convert hh:mm:ss string to an integer seconds. @@ -37,8 +39,8 @@ def seconds_to_hms(seconds, force_minutes=False, force_hours=False): return hms def main(args): - from voussoirkit import pipeable - for line in pipeable.go(args, strip=True, skip_blank=True): + lines = pipeable.input_many(args, strip=True, skip_blank=True) + for line in lines: if ':' in line: line = hms_to_seconds(line) else: @@ -46,7 +48,7 @@ def main(args): if line > 60: line = seconds_to_hms(line) - pipeable.stdout(f'{line}') + pipeable.stdout(line) if __name__ == '__main__': raise SystemExit(main(sys.argv[1:]))