[Getan-commits] [PATCH 2 of 2] getan-eval.py: improves diagnosis

Wald Commits scm-commit at wald.intevation.org
Mon May 29 14:22:19 CEST 2017


# HG changeset patch
# User Bernhard Reiter <bernhard at intevation.de>
# Date 1496060526 -7200
# Node ID 5ee2ce059338489e2f1fec65e806c182e329494f
# Parent  7adc6cd9d23a8dbd2b8bca8034dc4688c9a89f81
getan-eval.py: improves diagnosis.

 * (minor) In case of missing -u/--user parameter, scripts/getan-eval.py
   will output an error message.

diff -r 7adc6cd9d23a -r 5ee2ce059338 CHANGES
--- a/CHANGES	Mon May 29 14:06:31 2017 +0200
+++ b/CHANGES	Mon May 29 14:22:06 2017 +0200
@@ -1,5 +1,8 @@
 2.1 xx.xx.20xx UNRELEASED
 
+ * (minor) In case of missing -u/--user parameter, scripts/getan-eval.py
+   will output an error message.
+
 2.0 03.05.2017
 (Honoring Björn Ricks who did 90% of this release's development work.)
 
diff -r 7adc6cd9d23a -r 5ee2ce059338 scripts/getan-eval.py
--- 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,


More information about the Getan-commits mailing list