Commit 3a0e93a2 authored by Thomas Lotze's avatar Thomas Lotze

add filtering for a username

parent 02fe0e35
......@@ -22,8 +22,12 @@ import click
'--project',
help='Filter for project name',
)
def cli(url, token, month, project):
entries = fetch(url, token, month, project)
@click.option(
'--username',
help='Filter for user name',
)
def cli(url, token, month, project, username):
entries = fetch(url, token, month, project, username)
report(entries)
......
......@@ -23,7 +23,7 @@ def parse_time(time_str):
return float(value_str) * unit
def fetch(url, token, month, project_name):
def fetch(url, token, month, project_name, username):
"""Yield all relevant time tracking entries, in no particular order.
"""
......@@ -57,6 +57,9 @@ def fetch(url, token, month, project_name):
if note.body == 'removed time spent':
break
if username and note.author['username'] != username:
continue
sep = ' of time spent at '
action, _, date = note.body.partition(sep)
if _ != sep:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment