teichmann@8: #!/usr/bin/env python teichmann@8: # -*- coding: utf-8 -*- teichmann@8: # teichmann@8: # zeiterfassung teichmann@8: # ------------- teichmann@8: # (c) 2008 by Sascha L. Teichmann bjoern@128: # (c) 2011, 2012 by Björn Ricks teichmann@8: # teichmann@8: # Simple script which generates lines for zeiterfassung.txt files. teichmann@8: # teichmann@8: # This is Free Software licensed under the terms of GPLv3 or later. teichmann@8: # For details see LICENSE coming with the source of 'getan'. teichmann@8: # teichmann@8: import sys teichmann@8: import getopt teichmann@10: import codecs bjoern@127: import locale teichmann@8: bjoern@359: from datetime import datetime, timedelta teichmann@8: bjoern@359: from getan.template import render teichmann@8: teichmann@8: DEFAULT_DATABASE = "time.db" teichmann@8: bjoern@359: ZEITERFASSUNG_TEMPLATE = "zeiterfassung" teichmann@8: teichmann@8: USAGE = '''usage: %s teichmann@8: with bernhard@392: [--user=|-u ] : Name of user, default: $USER bernhard@392: [--database=|-d ]: getan database, default: time.db bernhard@392: [--project=|-p ] : Key of output project, default: all bernhard@392: [--encoding=|-e encoding] : encoding of output, default: none teichmann@13: [--week=]|-w ] : week of year bjoern@51: [--year=]|-y ] : year teichmann@8: [--list|-l] : list all projects bjoern@60: [--help|-h] : This text bjoern@108: [--emtpy|-m] : show empty projects bernhard@392: [--lastweek|-c] : entries of last working week bernhard@392: [--template|-t