Open
Conversation
Added four new commands: - Start clocking in the current heading - Stop last unfinished line in the current heading - Recalculate duration after manual change of clock line - Display total time for the current heading
Codecov Report
@@ Coverage Diff @@
## master #302 +/- ##
==========================================
- Coverage 84.38% 83.91% -0.47%
==========================================
Files 49 50 +1
Lines 6794 6863 +69
==========================================
+ Hits 5733 5759 +26
- Misses 1061 1104 +43
Continue to review full report at Codecov.
|
akstrfn
reviewed
Jun 20, 2018
Contributor
akstrfn
left a comment
There was a problem hiding this comment.
I've left some minor comments but in general LGTM ;)
| from orgmode.py3compat.unicode_compatibility import * | ||
|
|
||
|
|
||
| def get_total_time(heading): |
Contributor
There was a problem hiding this comment.
Maybe use generators:
total = sum(clockline for clockline in heading.logbook if not clockline.finished)
return total + sum(get_total_time(child) for child in heading.logbook)
| # -2 to skip heading itself and :LOGBOOK: | ||
| clockline_index = position - current_heading.start - 2 | ||
|
|
||
| if clockline_index < 0 or clockline_index >= len(current_heading.logbook): |
Contributor
There was a problem hiding this comment.
len(current_heading.logbook) <= clockline_index < 0
| self.logbook.clear() | ||
| for i, line in enumerate(self.document._content[self.start + 1:heading_end + 1]): | ||
| line_date = _text2orgdate(line) | ||
| if line_date is not None: |
Contributor
There was a problem hiding this comment.
if line_date: is enough or if line_date is None: continue with unindenting the current if block
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Added four new commands:
Please review whether my changes fit your architecture and style guides :)