def import_jammers(): try: jamsite = import_all_jammers(load_sources()) jamsite.save() flash("Done with the import! ") return redirect(url_for('index')) except IOError: flash(errormsg['missing_jammers_file']) return redirect(url_for('index')) except: import traceback return "<h1>not worky\n\r</h1><p>"+traceback.format_exc()+"</p>"\
parser.add_argument('--extra', action='store_true', default=None, help='Add extra information from other sources. Experience and Size fields(Tshirt)') args = parser.parse_args() # Load source from args if type(args.sources) is list: sources = [] for source in args.sources: if "http" in source: #foo hack to guess if fields is given, it belongs to an external source. sources.append(dict(url=source, fields=args.fields)) else: sources.append(dict(file=source)) else: # Load sources from config, if that fails, default. sources = load_sources() # Add extra fields to rendering. if args.extra is None: extra = load_extra() else: extra = True print(""" Starting to create the jammer cards. importing from %d source(s). Have yourself a cup of tea! This will take a couple of minutes the first time it is done. (Because it takes a while to fetch the profile pictures) Everything will be cached from now on,