[CI] fix a few lint errors
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
kleph 2021-03-31 04:47:25 +02:00
parent d7a483f386
commit e197117c0e

View file

@ -1,5 +1,9 @@
#!/usr/bin/python
"""
OBS countdown timer for OBS
"""
import argparse
import os
import time
@ -13,15 +17,16 @@ args = parser.parse_args()
def write_countdown(filename, stimer):
t = stimer
with open(filename, 'w') as f:
while t > 0:
t -= 1
min, sec = divmod(t, 60)
print(f'{min:02d}:{sec:02d}')
f.seek(0)
f.write(f'{min:02d}:{sec:02d}')
os.fsync(f)
""" decrease counter anf write synchronously to dest file """
tsec = stimer
with open(filename, 'w') as destfile:
while tsec > 0:
tsec -= 1
minutes, sec = divmod(tsec, 60)
print(f'{minutes:02d}:{sec:02d}')
destfile.seek(0)
destfile.write(f'{minutes:02d}:{sec:02d}')
os.fsync(destfile)
time.sleep(1)