Possibility of adding pomodoro-length entries #11
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.
This pull request introduces new functionality to the
main.py
file, specifically adding support for creating Pomodoro time entries that end at the moment of entry (thus starting 25 minutes before that). The most important changes include importing necessary modules, adding new methods to handle Pomodoro time entries, and modifying the event handling to support these new features.Pomodoro Time Entry Support:
Module Import:
timedelta
import from thedatetime
module to handle time calculations.Event Handling:
on_event
method to insert new items for creating Pomodoro time entries when the query starts with 'pd'.resume_pomodoro
andnew_pomodoro
calls in theon_event
method.New Methods:
get_time_minus_offset
method to calculate the time minus a specified offset in minutes.add_pomodoro_time_entry
method to create a new Pomodoro time entry, either resuming the last entry or creating a new one with a specified message.