Backported fix for broken config parser test.
1 parent 8960251 commit d30a3cdee38467c630bf4f234fec44b7cf3390ce
Nigel Stanger authored on 28 Aug 2018
Showing 1 changed file
View
14
config_parser.py
print " filename = '{f}'".format(f=s["filename"])
print " num = {n}".format(n=s["num"])
print " times = {t}".format(t=s["times"])
for i, t in enumerate(s["times"]):
if (isinstance(t, str)):
print " punch out after duration of '{f}'".format(f=t)
if (isinstance(t, ParseResults)):
if (i % 2 == 0):
print " punch in at: {hh:02d}:{mm:02d}:{ss:02d}.{ms:03d}".format(hh=t["hh"], mm=t["mm"], ss=t["ss"], ms=t["ms"])
else:
print " punch out at: {hh:02d}:{mm:02d}:{ss:02d}.{ms:03d}".format(hh=t["hh"], mm=t["mm"], ss=t["ss"], ms=t["ms"])
print " punch {io}".format(io="in" if i % 2 == 0 else "out"),
if len(t) > 1:
print "at: {hh:02d}:{mm:02d}:{ss:02d}.{ms:03d}".format(hh=t["hh"], mm=t["mm"], ss=t["ss"], ms=t["ms"])
else:
print "after duration of '{f}'".format(f=t["filename"])
print
 
 
if (__name__ == "__main__"):