"The gregorian calendar date of the first day of the given ISO year"
fourth_jan = dt.date(iso_year, 1, 4)
delta = dt.timedelta(fourth_jan.isoweekday()-1)
- return fourth_jan - delta
+ return fourth_jan - delta
def iso_to_gregorian(iso_year, iso_week, iso_day):
"Gregorian calendar date for the given ISO year, week and day"
# read and parse timeSampler files
#
files = [f for f in os.listdir(os.environ['HOME'])
- if f.startswith('.timeSampler') and not f.endswith('.gz')]
+ if f.startswith('.timeSampler') and not
+ (f.endswith('.gz') or f.endswith('.all'))]
hist = defaultdict(lambda: 0)
histHier = defaultdict(lambda: 0)
#print h.groups()
# segregate non-gtd-project items
- if len(t) < 3 or t[2] != '.':
+ #if len(t) < 3 or t[2] != '.':
+ if '.' not in t:
#if t.lower() == t and t[0:2] != 'ed' or t == 'Tasks':
histOther[t] += 1
else:
- histGtd[t[0:2]] += 1
+ a = t.split('.')
+ histGtd[a[0]] += 1
if hist:
maxlen = max(map(len, hist.iterkeys()))
if not opt.bare:
print ('%%%is' % (name_len + count_len + 2)) % sum(hist.values())
-
+
if opt.gtd:
if not opt.bare:
print '%-5s %4i' % (k, histGtd[k])
print 'other %4i' % (sum(hist.values()) - sum(histGtd.values()))
-#for k in sorted(histOther.keys()):
- #print '%s: %3i' % (k, histOther[k])
+ for k in sorted(histOther.keys()):
+ print '%s: %3i' % (k, histOther[k])