summaryrefslogtreecommitdiffstats
path: root/lps_gen.py
diff options
context:
space:
mode:
authorrsiddharth <rsd@gnu.org>2016-03-18 23:20:00 -0400
committerrsiddharth <rsd@gnu.org>2016-03-18 23:20:00 -0400
commitc9b3546c9f54bcd49a64906327eee9539efe27f2 (patch)
tree1b39b473098d2f246f0e516a3a2e2615c156c07c /lps_gen.py
parent6126b5871114b612ecb12f5471582853507ab12b (diff)
Add --ical switch
- With --ical ON and when LP schedule is given, `lps_gen` writes an LP schedule iCal to disk. Addresses issue #8.
Diffstat (limited to 'lps_gen.py')
-rw-r--r--lps_gen.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/lps_gen.py b/lps_gen.py
index 490efd5..9e09f94 100644
--- a/lps_gen.py
+++ b/lps_gen.py
@@ -552,6 +552,8 @@ def main():
group.add_argument("-sp", "--speakers", action="store_true",
help="Generate LP speakers")
+ parser.add_argument("--ical", type=int,
+ help="Specify LP year as argument; generates iCal")
parser.add_argument("--version", action="version",
version='lpschedule-generator version %s' % __version__,
help="Show version number and exit.")
@@ -575,6 +577,10 @@ def main():
lp_dict = markdown(lp_md_content)
lp_html = RenderHTML(lp_dict, lp_template)
+
+ if args.ical and args.schedule:
+ LPiCal(lp_dict, args.ical).to_ical()
+
else:
exit(1)