Mercurial > getan
changeset 347:3a1786947673
Fix coding style for pep8
author | Björn Ricks <bjoern.ricks@intevation.de> |
---|---|
date | Mon, 03 Mar 2014 11:34:31 +0100 |
parents | 3a80a914a024 |
children | 328ec66517b0 |
files | getan/contrib/getan-eval.py |
diffstat | 1 files changed, 8 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/getan/contrib/getan-eval.py Mon Mar 03 10:45:15 2014 +0100 +++ b/getan/contrib/getan-eval.py Mon Mar 03 11:34:31 2014 +0100 @@ -20,6 +20,7 @@ DEFAULT_DATABASE = "time.db" + def tolerant_close(c): if c: try: @@ -27,20 +28,21 @@ except: pass + def main(): parser = OptionParser() parser.add_option("-d", "--database", dest="database", - help="getan database", metavar="DATABASE") + help="getan database", metavar="DATABASE") parser.add_option("-t", "--template", dest="template", metavar="TEMPLATE", - help="name of getan template") + help="name of getan template") parser.add_option("-u", "--user", dest="user", help="name of user") parser.add_option("-p", "--project", dest="project", - help="key of output project") + help="key of output project") parser.add_option("-w", "--week", type="int", dest="week", - help="week of year") + help="week of year") parser.add_option("-y", "--year", type="int", dest="year", help="year") parser.add_option("-c", "--lastweek", dest="entries of last working week", - action="store_true") + action="store_true") (options, args) = parser.parse_args() @@ -65,11 +67,10 @@ year = int(date.today().strftime("%Y")) if week is None: - week = (datetime.now()-timedelta(7)).isocalendar()[1] + week = (datetime.now() - timedelta(7)).isocalendar()[1] u_week = "%02d" % unix_week(week, year) - if not os.path.isfile(database): print >> sys.stderr, "'%s' does not exist or is not a file." % database sys.exit(1)