summaryrefslogtreecommitdiff
path: root/planner_generator.py
diff options
context:
space:
mode:
Diffstat (limited to 'planner_generator.py')
-rwxr-xr-xplanner_generator.py29
1 files changed, 29 insertions, 0 deletions
diff --git a/planner_generator.py b/planner_generator.py
index b86ce68..eda562b 100755
--- a/planner_generator.py
+++ b/planner_generator.py
@@ -168,6 +168,35 @@ class WeeklyGenerator(Generator):
page += 1
+class DailyGenerator(Generator):
+ default_template = "daily-A6"
+
+ def generate_pages(self):
+ day = datetime.date(self.year, 1, 1)
+
+ # we want to start with a left side page (starting from 0)
+ page = 2
+ while day.year == self.year:
+ self.render_page(page=page, day=day)
+ page += 1
+ day += datetime.timedelta(days=1)
+
+ if day.year > self.year:
+ break
+
+ self.render_page(page=page, day=day)
+ page += 1
+ day += datetime.timedelta(days=1)
+
+ def get_pdf_pages(self):
+ pdf_pages = super().get_pdf_pages()
+ # insert an empty page on the second page, to start the year on
+ # a left page
+ pdf_pages.insert(1, "1, {}")
+
+ return pdf_pages
+
+
class Command:
"""
Generate a planner