don't show entries that are only declines
This commit is contained in:
parent
7295306107
commit
f1ebd8d4c6
1 changed files with 8 additions and 5 deletions
13
dudlebot.py
13
dudlebot.py
|
@ -127,12 +127,15 @@ class DudleBot:
|
|||
formatted_plan += f"{'|'.join([day.strftime('%A')[:2] for day in days])}"
|
||||
formatted_plan += "\n"
|
||||
|
||||
if len(plan.entries) == 0:
|
||||
entries = {-1: PlanEntry(name="???", responses=[])}
|
||||
else:
|
||||
entries = plan.entries
|
||||
entries_with_content = [entry for entry in plan.entries.values() if
|
||||
any(response != PlanResponse.NO for response in entry.responses)]
|
||||
|
||||
for entry in entries.values():
|
||||
if len(entries_with_content) == 0:
|
||||
entries = [PlanEntry(name="???", responses=[])]
|
||||
else:
|
||||
entries = plan.entries.values()
|
||||
|
||||
for entry in entries:
|
||||
responses = [entry.responses[i] if i < len(entry.responses) else PlanResponse.UNKNOWN
|
||||
for i in range(plan.duration.days)]
|
||||
|
||||
|
|
Loading…
Reference in a new issue