Skip to content

Commit

Permalink
"timeshit": Add support for entry comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
damiendart committed Aug 25, 2024
1 parent 811751f commit fc9fa94
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion bin/timeshit
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@ A little tool to parse and summarise basic plain-text timesheets.
Inspired by <https://github.com/dantleech/pttlog>, but much smaller in
scope. A timesheet file represents a day of tasks, and entries are lines
that start with a timestamp followed by a description, eg:
that start with a timestamp followed whitespace and a description, eg:
09:00 Morning routine and meeting
09:30 A task that lasts an hour
10:30-12:00 Another task with an optional end time
13:00 Another task # Everything after the "#" is ignored.
Entries must be in chronological order. If an entry does not include an
end time the start time of the following task is used, unless it is the
Expand Down Expand Up @@ -74,6 +75,8 @@ def main(arguments: argparse.Namespace) -> None:
except ValueError:
raise TimesheetParseError("entry has no description", i + 1)

description = description.split("#")[0].strip()

if "-" in time:
start, end = time.split("-")
entries.append(
Expand Down

0 comments on commit fc9fa94

Please sign in to comment.