Commit 200085d7f050fba4d2e5fb384a1d74e6bc4d022e

  • avatar
  • arvind
  • Thu Jan 09 21:10:04 IST 2014
* report.py: Fixing typo and adding some documentation about options for the script.
  • Diff rendering mode:
  • inline
  • side by side

report.py

2import datetime2import datetime
3import query3import query
44
5parser = argparse.ArgumentParser(description='Generate report for the date specified.')
5parser = argparse.ArgumentParser(description="""Generate report for the date specified.
6 Start and end date default to present day.
7 Start time defaults to 00:00:00.
8 End time defaults to 23:59:59.""")
6parser.add_argument('-s','--start-date', type=str, default=datetime.datetime.strftime(datetime.date.today(), '%Y-%m-%d'), help="Start date (YYYY-MM-DD)")9parser.add_argument('-s','--start-date', type=str, default=datetime.datetime.strftime(datetime.date.today(), '%Y-%m-%d'), help="Start date (YYYY-MM-DD)")
7parser.add_argument('-e','--end-date', type=str, default=datetime.datetime.strftime(datetime.date.today(), '%Y-%m-%d'), help="End date (YYYY-MM-DD)")10parser.add_argument('-e','--end-date', type=str, default=datetime.datetime.strftime(datetime.date.today(), '%Y-%m-%d'), help="End date (YYYY-MM-DD)")
8parser.add_argument('-S','--start-time', type=str, default = '00:00:00', help="Start time (HH:MM:SS)")11parser.add_argument('-S','--start-time', type=str, default = '00:00:00', help="Start time (HH:MM:SS)")
9parser.add_argument('-E','--end-time', type=str, default='23:59:59', help="Start time (HH:MM:SS)")
12parser.add_argument('-E','--end-time', type=str, default='23:59:59', help="End time (HH:MM:SS)")
1013
1114
12args = parser.parse_args()15args = parser.parse_args()