lpschedule-generator

libreplanet schedule generator - ricketyspace.net/lpschedule-generator
git clone git://git.ricketyspace.net/lpschedule-generator.git
Log | Files | Refs

commit 8bbbd13d95825e2b5590cf17f2829115e7537684
parent 19c1ac03e916561f2458312e5c9251b0b9eab075
Author: rsiddharth <rsd@gnu.org>
Date:   Sat, 19 Dec 2015 18:35:16 -0500

updated lps_gen.main

The function now reads the LP `year` and the path to the LP schedule
markdown file from the commandline and stdouts the HTML version of the
LP schedule.

Diffstat:
lps_gen.py | 17+++++++++++++++--
1 file changed, 15 insertions(+), 2 deletions(-)

diff --git a/lps_gen.py b/lps_gen.py @@ -169,14 +169,27 @@ def RenderHTML(lps_dict, year): def main(): parser = ArgumentParser() + parser.add_argument("year", + help="LP Schedule year.") parser.add_argument("lps_md", help="Path to the markdown version of LP Schedule.") args = parser.parse_args() lps_md_content = read_file(path.abspath(args.lps_md)) + lp_year = args.year - markdown = LPSMarkdown() - lps_dict = markdown(lps_md_content) + if lps_md_content: + markdown = LPSMarkdown() + lps_dict = markdown(lps_md_content) + lps_html = RenderHTML(lps_dict, lp_year) + else: + exit(1) + + if lps_html: + # stdout lps html + print lps_html + else: + print 'Error generating LP HTML.' if __name__ == "__main__":