summaryrefslogtreecommitdiff
path: root/planner_generator.py
diff options
context:
space:
mode:
authorElena ``of Valhalla'' Grandi <valhalla@trueelena.org>2021-12-28 17:11:14 +0100
committerElena ``of Valhalla'' Grandi <valhalla@trueelena.org>2021-12-28 17:11:14 +0100
commit61541a294b2d0fd06749ebcff2ded1ccc563dfe0 (patch)
tree6853561228724756aee7177d159b298e48c5c213 /planner_generator.py
parent325cf6b8f6e7087074f1860e871b882507ff8bba (diff)
New planner: month view
Diffstat (limited to 'planner_generator.py')
-rwxr-xr-xplanner_generator.py22
1 files changed, 22 insertions, 0 deletions
diff --git a/planner_generator.py b/planner_generator.py
index eda562b..7107d44 100755
--- a/planner_generator.py
+++ b/planner_generator.py
@@ -197,6 +197,28 @@ class DailyGenerator(Generator):
return pdf_pages
+class MonthGenerator(Generator):
+ """
+ """
+ default_template = "month-A6"
+
+ def generate_pages(self):
+ cal = calendar.Calendar()
+ full_year = cal.yeardatescalendar(self.year, width=1)
+ months = []
+
+ for i in range(12):
+ months.append([
+ day for week in full_year[i][0] for day in week
+ if day.month == i + 1
+ ])
+
+ page = 1
+ for month in months:
+ self.render_page(page=page, month=month, text=[])
+ page += 1
+
+
class Command:
"""
Generate a planner