lpschedule-generator

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

commit da87e2cc84263245688246c8ba4dec40d7cb7934
parent 700229847e2bb56e607a439d683da13bd84990b8
Author: rsiddharth <rsd@gnu.org>
Date:   Sun,  7 Feb 2016 14:15:54 -0500

updated main()

Added two mutually exclusive switches:

     --schedule
     --speakers

If --schedule switch is used, the lps_gen inteprets that the template
and the MD file corresponding to LP schedule.

If --speakers switch is used, the lps_gen inteprets that the template
and the MD file corresponding to LP speakers.

Address issue #1.

Diffstat:
lps_gen.py | 16+++++++++++++++-
1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/lps_gen.py b/lps_gen.py @@ -278,6 +278,13 @@ def RenderHTML(lp_dict, template): def main(): parser = ArgumentParser() + + group = parser.add_mutually_exclusive_group() + group.add_argument("-s", "--schedule", action="store_true", + help="Generate LP schedule") + group.add_argument("-sp", "--speakers", action="store_true", + help="Generate LP speakers") + parser.add_argument("--version", action="version", version='lpschedule-generator version %s' % __version__, help="Show version number and exit.") @@ -291,7 +298,14 @@ def main(): lp_md_content = read_file(path.abspath(args.lp_md)) if path.exists(lp_template) and lp_md_content: - markdown = LPSMarkdown() + + if args.schedule: + markdown = LPSMarkdown() + elif args.speakers: + markdown = LPSpeakersMarkdown() + else: + parser.error('No action requested, add -s or -sp switch') + lp_dict = markdown(lp_md_content) lp_html = RenderHTML(lp_dict, lp_template) else: