Compare commits
No commits in common. "301dbbbc8273eb135ef989ffb20eeb1dcb094a08" and "42c85f44681cdddad49f5148bbaf47d7237f4a90" have entirely different histories.
301dbbbc82
...
42c85f4468
@ -188,27 +188,13 @@ def cmd_week(args):
|
||||
since = args.since or _default_since()
|
||||
events = list(_scan_git(since))
|
||||
totals = _tid_totals()
|
||||
if not events:
|
||||
print(f"no task events since {since}"); return
|
||||
by_day = defaultdict(list)
|
||||
git_tids = set()
|
||||
for ts, kind, tid, file, desc in events:
|
||||
day = ts[:10]
|
||||
by_day[day].append((ts, kind, tid, file, desc))
|
||||
git_tids.add(tid)
|
||||
seen_tid_days = set()
|
||||
for r in read_rows():
|
||||
if not r["stopped_at"]:
|
||||
continue
|
||||
day = r["started_at"][:10]
|
||||
if day < since[:10]:
|
||||
continue
|
||||
tid = r["tid"]
|
||||
if tid in git_tids or (day, tid) in seen_tid_days:
|
||||
continue
|
||||
seen_tid_days.add((day, tid))
|
||||
by_day[day].append((r["started_at"], "time", tid, r["file"], r["description"]))
|
||||
if not by_day:
|
||||
print(f"no task events since {since}"); return
|
||||
marker = {"done": "[x]", "new": "[ ]", "done+new": "[+]", "reopen": "[o]", "time": "[-]"}
|
||||
marker = {"done": "[x]", "new": "[ ]", "done+new": "[+]", "reopen": "[o]"}
|
||||
n_done = n_new = total_secs = 0
|
||||
counted_tids = set()
|
||||
print(f"Week since {since}\n")
|
||||
@ -218,7 +204,7 @@ def cmd_week(args):
|
||||
for ts, kind, tid, file, desc in by_day[day]:
|
||||
t = totals.get(tid, 0)
|
||||
dur = _fmt_dur(t) if t else " "
|
||||
print(f" {marker.get(kind,'? ')} {tid:<24} {dur:>6} {file:<36} {desc[:60]}")
|
||||
print(f" {marker.get(kind,'? ')} {tid:<24} {dur:>6} {file} — {desc[:60]}")
|
||||
if kind in ("done", "done+new"): n_done += 1
|
||||
if kind in ("new", "done+new"): n_new += 1
|
||||
if tid not in counted_tids:
|
||||
|
||||
Loading…
Reference in New Issue
Block a user