Mercurial > getan
changeset 392:617ced8c7a40
scripts/zeiterfassung.py: enabled choice of used templates.
author | Bernhard Reiter <bernhard@intevation.de> |
---|---|
date | Mon, 16 Feb 2015 10:21:22 +0100 |
parents | 58537062fe74 |
children | f155d93088a2 |
files | scripts/zeiterfassung.py |
diffstat | 1 files changed, 12 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/scripts/zeiterfassung.py Mon Feb 09 10:17:25 2015 +0100 +++ b/scripts/zeiterfassung.py Mon Feb 16 10:21:22 2015 +0100 @@ -26,20 +26,22 @@ USAGE = '''usage: %s <options> with <options> - [--user=|-u <user>] : Name of user, default: $USER - [--database=|-d <database>]: getan database, default: time.db - [--project=|-p <key>] : Key of output project, default: all - [--encoding=|-e encoding] : encoding of output, default: none + [--user=|-u <user>] : Name of user, default: $USER + [--database=|-d <database>]: getan database, default: time.db + [--project=|-p <key>] : Key of output project, default: all + [--encoding=|-e encoding] : encoding of output, default: none [--week=]|-w <week>] : week of year [--year=]|-y <year>] : year [--list|-l] : list all projects [--help|-h] : This text [--emtpy|-m] : show empty projects - [--lastweek|-c] : entries of last working week''' + [--lastweek|-c] : entries of last working week + [--template|-t <template>] : jinja2 template to use, default: zeiterfassung +''' def usage(exit_code=0): - print USAGE % sys.argv[0] + print USAGE % sys.argv[0], sys.exit(exit_code) @@ -58,9 +60,9 @@ opts, args = getopt.getopt( sys.argv[1:], - 'd:u:p:e:hl:w:y:mc', + 'd:u:p:e:hl:w:y:mct:', ['database=', 'user=', 'project=', 'encoding=', 'help', 'list', 'week=', - 'year=', 'empty', 'lastweek']) + 'year=', 'empty', 'lastweek', 'template=']) for opt, val in opts: if opt in ("--database", "-d"): @@ -83,6 +85,8 @@ week = (datetime.now() - timedelta(7)).isocalendar()[1] elif opt in ("--empty", "-m"): empty_proj = True + elif opt in ("--template", "-t"): + template = val if not encoding: encoding = locale.getdefaultlocale()[1]