Skip to content

Instantly share code, notes, and snippets.

@william20111
Created May 20, 2014 09:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save william20111/90c3329db84fe890b220 to your computer and use it in GitHub Desktop.
Save william20111/90c3329db84fe890b220 to your computer and use it in GitHub Desktop.
timemanage.py
#!/usr/bin/python3
import click
import logging
import datetime
FORMAT='%(asctime)s %(message)s'
fmt='%m/%d/%Y %I:%M:%S %p'
logging.basicConfig(format=FORMAT, filename='/home/william/.timemanagement.log',level=logging.DEBUG, datefmt=fmt)
@click.command()
@click.option('--time', prompt='Time', required=True, help='Task Time', type=float)
@click.option('--task', prompt='Task', required=True, help='Task Name')
def add(task, time):
click.echo('Added %s' % task)
logger = logging.getLogger()
logger.info('| Task: %s | Time Estimated: %s hours', task, time)
if __name__ == '__main__':
add()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment