Compare commits
2 commits
c7a2f98421
...
37381dd947
Author | SHA1 | Date | |
---|---|---|---|
37381dd947 | |||
1b25bb2edc |
1 changed files with 9 additions and 19 deletions
|
@ -93,7 +93,10 @@ with DAVClient(
|
||||||
task.expand_rrule(yesterday, next_week)
|
task.expand_rrule(yesterday, next_week)
|
||||||
due = coerce_date(due)
|
due = coerce_date(due)
|
||||||
|
|
||||||
|
try:
|
||||||
start = coerce_date(task.icalendar_component.get("dtstart").dt or yesterday)
|
start = coerce_date(task.icalendar_component.get("dtstart").dt or yesterday)
|
||||||
|
except:
|
||||||
|
start = yesterday
|
||||||
|
|
||||||
if today < start:
|
if today < start:
|
||||||
continue
|
continue
|
||||||
|
@ -118,28 +121,15 @@ with DAVClient(
|
||||||
else:
|
else:
|
||||||
scheduled.append(event)
|
scheduled.append(event)
|
||||||
|
|
||||||
should_do = shuffle_with_priority(should_do)
|
should_want = shuffle_with_priority(should_do) + shuffle_with_priority(want_to_do)
|
||||||
want_to_do = shuffle_with_priority(want_to_do)
|
|
||||||
|
|
||||||
while len(must_do) < 2:
|
|
||||||
if should_do:
|
|
||||||
must_do.append(should_do.pop(0))
|
|
||||||
elif want_to_do:
|
|
||||||
must_do.append(want_to_do.pop(0))
|
|
||||||
else:
|
|
||||||
break # No remaining tasks
|
|
||||||
|
|
||||||
while len(should_do) < 3:
|
|
||||||
if want_to_do:
|
|
||||||
should_do.append(want_to_do.pop(0))
|
|
||||||
else:
|
|
||||||
break # No remaining tasks
|
|
||||||
|
|
||||||
categories = {
|
categories = {
|
||||||
"Must do": must_do,
|
"Must do": must_do,
|
||||||
"Should do": should_do[:3],
|
"Should do": should_want[:3],
|
||||||
"Want to do": want_to_do[:3],
|
"Want to do": should_want[3:6],
|
||||||
}
|
}
|
||||||
|
if len(should_want) > 6:
|
||||||
|
categories["Leftover"] = sould_want[7:]
|
||||||
|
|
||||||
with p:
|
with p:
|
||||||
log.debug("Printing output")
|
log.debug("Printing output")
|
||||||
|
|
Loading…
Add table
Reference in a new issue