Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions dit/dit_exporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ def task(group, group_id, subgroup, subgroup_id, task, task_id, data):
_overall_time_spent += time_spent

if statussing and not verbose:
first_entry = logbook[0]
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This may not be the actual first entry because the logbook variable comes from the filtered data which may not contain all logbook entries.

So you need to either make sure this is never the case (with tests?) or take this from the unfiltered data.

log = logbook[-1]
string = ' '

Expand All @@ -199,10 +200,11 @@ def _phrase(description, value):

if time_spent:
string += "%s %s. " % (_ce('Spent'), td2str(time_spent))
string += "\n %s %s." % (_ce('First clocked in at'), dt2str(first_entry['in']))
if log['out']:
string += "%s %s." % (_ce('Clocked out at'), dt2str(log['out']))
string += "\n %s %s." % (_ce('Clocked out at'), dt2str(log['out']))
else:
string += "%s %s." % (_cf('Clocked in at'), dt2str(log['in']))
string += "\n %s %s." % (_cf('Clocked in at'), dt2str(log['in']))
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of manually breaking lines, I think it would be better to call _write.

_write(string)

else:
Expand Down