def main(): usage = "\n".join(["usage: %prog [options] [filenames]", "Parses core classes from psrd html to json and writes them to the " "specified directory"]) parser = option_parser(usage) parser.add_option( "-c", "--class_type", dest="class_type", help="Type of class (core, base, prestige, npc (default core)") (options, _) = parser.parse_args() fxn = parse_core_classes if options.class_type == 'base': fxn = parse_base_classes elif options.class_type == 'hybrid': fxn = parse_hybrid_classes elif options.class_type == 'prestige': fxn = parse_prestige_classes elif options.class_type == 'npc': fxn = parse_npc_classes elif options.class_type == 'core' or options.class_type == None: fxn = parse_core_classes else: sys.stderr.write("class type of %s is invalid" % options.class_type) exec_main(parser, fxn, "classes")
def main(): usage = "usage: %prog [options] [filenames]\nParses files from psrd html to json and writes them to the specified directory" parser = option_parser(usage, title=True) parser.add_option("-n", "--no-statblocks", dest="no_statblocks", default=False, action="store_true", help="Don't parse statblocks") (options, args) = parser.parse_args() fxn = parse_rules if options.no_statblocks: fxn = parse_rules_no_sb exec_main(parser, fxn, "rules")
def main(): usage = "usage: %prog [options] [filenames]\nParses races from psrd html to json and writes them to the specified directory" parser = option_parser(usage) parser.add_option("-t", "--type", dest="type", help="Race type") (options, args) = parser.parse_args() fxn = parse_arg_core_race if options.type == 'core': fxn = parse_arg_core_race elif options.type == 'featured': fxn = parse_arg_featured_race elif options.type == 'uncommon': fxn = parse_arg_uncommon_race exec_main(parser, fxn, "races")
def main(): usage = "usage: %prog [options] [filenames]\nParses skills from psrd html to json and writes them to the specified directory" parser = option_parser(usage) exec_main(parser, parse_skills, "skills")
def main(): usage = "usage: %prog [options] [filenames]\nParses spell lists from psrd html to json and writes them to the specified directory" parser = option_parser(usage) exec_main(parser, parse_spell_lists, "spell_lists")
def main(): usage = "usage: %prog [options] [filenames]\nParses creatures from psrd html to json and writes them to the specified directory" parser = option_parser(usage) exec_main(parser, parse_creature, "creatures")
def main(): usage = "usage: %prog [options] [filenames]\nParses files from psrd html to json and writes them to the specified directory" parser = option_parser(usage, title=True) exec_main(parser, parse_rules, "rules")