diff --git a/timetracker.py b/timetracker.py index fa2be57..887814e 100755 --- a/timetracker.py +++ b/timetracker.py @@ -20,7 +20,7 @@ comment = re.compile("^\s*#") # regex for finding empty lines (and skipp delim = re.compile(":\s{2}") # regex for splitting timestamp entry begin = re.compile("^Begin\s(?P.*)\s*$") end = re.compile("^End\s{3}(?P.*)\s*$") -case = re.compile("^(PDROP|CHG)-?\d+") +#case = re.compile("^(PDROP|CHG)-?\d+") for line in fileinput.input(): if empty.match(line) or comment.match(line): # if the current line is empty @@ -79,15 +79,15 @@ for act in sorted(start.keys()): else: gtoth += nearest(delta/3600.00) -ttot = 0 -utot = 0 +#ttot = 0 +#utot = 0 table = "{a:<50} {f:>10}" for act in sorted(ind.keys()): #minutes = "{:d}min".format(int(ind[act]%3600/60)) #hrs = "{:d}hrs".format(int(nearest(ind[act]/3600))) - if ind[act] <= 300: + if ind[act] <= 288: fhrs = "{:.2f}hrs".format(0.08) else: fhrs = "{:.2f}hrs".format(nearest(ind[act]/3600.00)) @@ -95,10 +95,10 @@ for act in sorted(ind.keys()): #print table.format(a=act, s=sec, h=hrs, m=minutes, f=fhrs) print table.format(a=act, f=fhrs) - if case.match(act): - ttot += ind[act] - else: - utot += ind[act] +# if case.match(act): +# ttot += ind[act] +# else: +# utot += ind[act] total = "{t:<20} {h:>10}"