timetrack/cli.py
def add(ctx, project, time, comment, date, task):
    """Add a time entry to a given project"""
    driver = ctx.obj['DRIVER']

    if time == "live":
        time = live_time(project)
        
    comment = " ".join(comment)
    
    if date is None:
        when = datetime.now()
        
    else:
        when = moment.date(date).datetime

    print("Adding {} minutes to {} project".format(parse_time(time), project))
    try:
        driver.add_entry(project, time, comment, when=when, task=task)
    except Exception as e:
        print("ERROR:", e)
        traceback.print_exc()
Add a time entry to a given project
Add a time entry to a given project
Add a time entry to a given project
def add(ctx, project, time, comment, date, task):
    driver = ctx.obj['DRIVER']
    if time == "live":
        time = live_time(project)
    comment = " ".join(comment)
    if date is None:
        when = datetime.now()
    else:
        when = moment.date(date).datetime
    print("Adding {} minutes to {} project".format(parse_time(time), project))
    try:
        driver.add_entry(project, time, comment, when=when, task=task)
    except Exception as e:
        print("ERROR:", e)
        traceback.print_exc()
def add ( ctx , project , time , comment , date , task ) : driver = ctx . obj [ 'DRIVER' ] if time == "live" : time = live_time ( project ) comment = " " . join ( comment ) if date is None : when = datetime . now ( ) else : when = moment . date ( date ) . datetime print ( "Adding {} minutes to {} project" . format ( parse_time ( time ) , project ) ) try : driver . add_entry ( project , time , comment , when = when , task = task ) except Exception as e : print ( "ERROR:" , e ) traceback . print_exc ( )
Add a time entry to a given project
Add a time entry to a given project
"""Add a time entry to a given project"""
ctx
project
time
comment
date
task