don't show entries that are only declines

This commit is contained in:
Tomáš Mládek 2019-10-23 10:25:52 +02:00
parent 7295306107
commit f1ebd8d4c6

View file

@ -127,12 +127,15 @@ class DudleBot:
formatted_plan += f"{'|'.join([day.strftime('%A')[:2] for day in days])}" formatted_plan += f"{'|'.join([day.strftime('%A')[:2] for day in days])}"
formatted_plan += "\n" formatted_plan += "\n"
if len(plan.entries) == 0: entries_with_content = [entry for entry in plan.entries.values() if
entries = {-1: PlanEntry(name="???", responses=[])} any(response != PlanResponse.NO for response in entry.responses)]
else:
entries = plan.entries
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 responses = [entry.responses[i] if i < len(entry.responses) else PlanResponse.UNKNOWN
for i in range(plan.duration.days)] for i in range(plan.duration.days)]