summaryrefslogtreecommitdiff
path: root/planner/planner_generator.py
diff options
context:
space:
mode:
Diffstat (limited to 'planner/planner_generator.py')
-rwxr-xr-xplanner/planner_generator.py25
1 files changed, 25 insertions, 0 deletions
diff --git a/planner/planner_generator.py b/planner/planner_generator.py
index d748fff..5d9e397 100755
--- a/planner/planner_generator.py
+++ b/planner/planner_generator.py
@@ -236,6 +236,31 @@ class DailyGenerator(Generator):
return pdf_pages
+class BiweeklyGenerator(Generator):
+ """
+ """
+ default_template = "week_on_one_page-A6"
+
+ def generate_pages(self):
+ cal = calendar.Calendar()
+ weeks = sum(
+ [r[0] for r in cal.yeardatescalendar(self.year, width=1)],
+ []
+ )
+
+ last_monday = None
+ page = 1
+ for week in weeks:
+ # yeardatescalendar will have the same week twice at the
+ # margin of a month, but we want to skip one of those
+ if week[0] == last_monday:
+ continue
+ last_monday = week[0]
+
+ self.render_page(page=page, week=week)
+ page += 1
+
+
class MonthGenerator(Generator):
"""
"""