timetrack/cli.py
def live_time(project):
    """Run a timer actively in the window"""
    start = datetime.now()

    print("Starting timer, press Ctrl + C at any time to end recording...")

    running = True

    widgets = ['Project:{} '.format(project), Timer(), '']

    with ProgressBar(widgets=widgets) as pbar:
        while(running):
            try:
                time.sleep(1)
                pbar.update(0)
            except KeyboardInterrupt:
                running = False

    end = datetime.now()

    diff = end - start

    return (int(diff.total_seconds()) / 60)
Run a timer actively in the window
Run a timer actively in the window
Run a timer actively in the window
def live_time(project):
    start = datetime.now()
    print("Starting timer, press Ctrl + C at any time to end recording...")
    running = True
    widgets = ['Project:{} '.format(project), Timer(), '']
    with ProgressBar(widgets=widgets) as pbar:
        while(running):
            try:
                time.sleep(1)
                pbar.update(0)
            except KeyboardInterrupt:
                running = False
    end = datetime.now()
    diff = end - start
    return (int(diff.total_seconds()) / 60)
def live_time ( project ) : start = datetime . now ( ) print ( "Starting timer, press Ctrl + C at any time to end recording..." ) running = True widgets = [ 'Project:{} ' . format ( project ) , Timer ( ) , '' ] with ProgressBar ( widgets = widgets ) as pbar : while ( running ) : try : time . sleep ( 1 ) pbar . update ( 0 ) except KeyboardInterrupt : running = False end = datetime . now ( ) diff = end - start return ( int ( diff . total_seconds ( ) ) / 60 )
Run a timer actively in the window
Run a timer actively in the window
"""Run a timer actively in the window"""
project