diff scripts/getan-eval.py @ 429:5ee2ce059338

getan-eval.py: improves diagnosis. * (minor) In case of missing -u/--user parameter, scripts/getan-eval.py will output an error message.
author Bernhard Reiter <bernhard@intevation.de>
date Mon, 29 May 2017 14:22:06 +0200
parents da9a400848fd
children e2b05afaf1bc
line wrap: on
line diff
--- a/scripts/getan-eval.py	Mon May 29 14:06:31 2017 +0200
+++ b/scripts/getan-eval.py	Mon May 29 14:22:06 2017 +0200
@@ -22,7 +22,8 @@
                       help="getan database",  metavar="DATABASE")
     parser.add_option("-t", "--template", dest="template", metavar="TEMPLATE",
                       help="name of getan template")
-    parser.add_option("-u", "--user", dest="user", help="name of user")
+    parser.add_option("-u", "--user", dest="user",
+                      help="[REQUIRED] name of user")
     parser.add_option("-p", "--project", dest="project",
                       help="key of output project")
     parser.add_option("-w", "--week", type="int", dest="week",
@@ -56,6 +57,8 @@
 
     if options.user:
         user = options.user.decode(encoding)
+    else:
+        parser.error("You have to give the -u/--user parameter.")
 
     print render(database=options.database, user=user,
                  template=template_name, year=year, week=week,
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)