comparison scripts/getan-eval.py @ 430:e2b05afaf1bc

Backed out changeset 5ee2ce059338.
author Bernhard Reiter <bernhard@intevation.de>
date Tue, 30 May 2017 08:48:36 +0200
parents 5ee2ce059338
children 8922713adbe6
comparison
equal deleted inserted replaced
429:5ee2ce059338 430:e2b05afaf1bc
20 parser = OptionParser() 20 parser = OptionParser()
21 parser.add_option("-d", "--database", dest="database", 21 parser.add_option("-d", "--database", dest="database",
22 help="getan database", metavar="DATABASE") 22 help="getan database", metavar="DATABASE")
23 parser.add_option("-t", "--template", dest="template", metavar="TEMPLATE", 23 parser.add_option("-t", "--template", dest="template", metavar="TEMPLATE",
24 help="name of getan template") 24 help="name of getan template")
25 parser.add_option("-u", "--user", dest="user", 25 parser.add_option("-u", "--user", dest="user", help="name of user")
26 help="[REQUIRED] name of user")
27 parser.add_option("-p", "--project", dest="project", 26 parser.add_option("-p", "--project", dest="project",
28 help="key of output project") 27 help="key of output project")
29 parser.add_option("-w", "--week", type="int", dest="week", 28 parser.add_option("-w", "--week", type="int", dest="week",
30 help="week of year") 29 help="week of year")
31 parser.add_option("-y", "--year", type="int", dest="year", help="year") 30 parser.add_option("-y", "--year", type="int", dest="year", help="year")
55 Writer = codecs.getwriter(encoding) 54 Writer = codecs.getwriter(encoding)
56 sys.stdout = Writer(sys.stdout) 55 sys.stdout = Writer(sys.stdout)
57 56
58 if options.user: 57 if options.user:
59 user = options.user.decode(encoding) 58 user = options.user.decode(encoding)
60 else:
61 parser.error("You have to give the -u/--user parameter.")
62 59
63 print render(database=options.database, user=user, 60 print render(database=options.database, user=user,
64 template=template_name, year=year, week=week, 61 template=template_name, year=year, week=week,
65 project=options.project, empty_projects=options.empty) 62 project=options.project, empty_projects=options.empty)
66 63
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)