-
-
Notifications
You must be signed in to change notification settings - Fork 77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Show weekly slacking in reports #198
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know if I want this in my reports.
I could chicken out and ask for a setting.... (or a couple of settings: sort order and show slack)
In any case I cannot merge this while tests are broken.
@@ -71,6 +71,9 @@ def parse_time(t): | |||
raise ValueError('bad time: %r' % t) | |||
hour, min = map(int, m.groups()) | |||
return datetime.time(hour, min) | |||
|
|||
def by_duration(e): | |||
return e[1] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, this is not generic enough to be a global function.
@@ -656,7 +659,7 @@ def _plain_report(self, output, email, who, subject, period_name): | |||
categories = {} | |||
if work: | |||
work = [(entry, duration) for start, entry, duration in work] | |||
work.sort() | |||
work.sort(reverse=True, key=by_duration) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is nice, but by_duration is not useful in other contexts, so it ought to be defined here, or, even better, you can do
work = sorted(((duration, entry) for start, entry, duration in work), reverse=True)
and swap entry, duration
in the for loop below.
@@ -678,6 +681,21 @@ def _plain_report(self, output, email, who, subject, period_name): | |||
tags = self.window.set_of_all_tags() | |||
if tags: | |||
self._report_tags(output, tags) | |||
|
|||
output.write('\nSlacking:\n\n') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this heading be there when there are no slack items?
It would be more convenient to see total slacking time and slacking time for each activity in weekly and monthly reports to analyze what activities you waste time for.