args = parser.parse_args() classes = [] spells = [] names = [] profs = [] if len(args.classes) > 0: classes = libhenches.parseClasses(args.classes) if len(args.spells) > 0: spells = libspellbook.parseSpells(args.spells) if len(args.names) > 0: names = libhenches.parseNames(args.names) if args.treasure != "": tables.loadtables(args.treasure) if args.genprofs != "": profs = libhenches.parseProfs(args.genprofs) if args.filterclass: cl = [t[0] for t in classes] if args.filterclass not in cl: print "Class %s not found in class file (used same case?)" % args.filterclass sys.exit(1) if args.market == 10: if args.filterclass: ol = libhenches.genHenchesFiltered(args.filterclass, args.num, int(args.level), classes, args.market, args.alignment, spells, names, profs, args.treasure != '') else: ol = libhenches.genHenches(args.num, int(args.level), classes,
app = Flask(__name__) classfile = './classes' spellsfile = './spells' profsfile = './genprofs' namefile = './germans' pcclassfile = './pcclasses' pcspellsfile = './pcspells' classes = libhenches.parseClasses(classfile) pcclasses = libhenches.parseClasses(pcclassfile) spells = libspellbook.parseSpells(spellsfile) pcspells = libspellbook.parseSpells(pcspellsfile) names = libhenches.parseNames(namefile) profs = libhenches.parseProfs(profsfile) marketvals = libhenches.marketClasses @app.route('/') def halp(): return "halp hao do wobsit" @app.route('/hench') @app.route('/hench/') def genhenches(market=None, pc=False): market = int(request.args.get('market',4)) pc = request.args.get('pc','') if not market or 1 > market or 6 < market: market = 4 useclasses = pcclasses if pc else classes usespells = pcspells if pc else spells
args = parser.parse_args() classes = [] spells = [] names = [] profs = [] if len(args.classes) > 0: classes = libhenches.parseClasses(args.classes) if len(args.spells) > 0: spells = libspellbook.parseSpells(args.spells) if len(args.names) > 0: names = libhenches.parseNames(args.names) if args.treasure != "": tables.loadtables(args.treasure) if args.genprofs != "": profs = libhenches.parseProfs(args.genprofs) if args.filterclass: cl = [t[0] for t in classes] if args.filterclass not in cl: print "Class %s not found in class file (used same case?)" % args.filterclass sys.exit(1) if args.market == 10: if args.filterclass: ol = libhenches.genHenchesFiltered( args.filterclass, args.num, int(args.level), classes,