Skip to content
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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

beaver4
Copy link

@beaver4 beaver4 commented Oct 10, 2020

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.

Copy link
Member

@mgedmin mgedmin left a 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]
Copy link
Member

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)
Copy link
Member

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')
Copy link
Member

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants