Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Now ttrack uses cmdparser and own time parsing.
All ttrack commands now use the cmdparser library to automatically generate a parser for the command based on the command syntax in the docstring. Command error reporting is quite different as a result (hopefully more helpful) and a lot of the boiler-plate error checking and command completion functions have been stripped out. The new datetimeparse library, based on classes in cmdparser, now replaces the third party parsedatetime library. This is mostly because this library made some annoying assumptions - for example, days of the week defaulted to the next instance, which is almost never what you want when adjusting start/stop times. The new library also allows a much nicer syntax for specifying periods (see next paragraph). The summary command has seen some significant syntactic differences - instead of choosing from a fixed list of period types (day, week, month), a fairly freeform date/time syntax is now permitted, which can run between arbitrary dates. The underlying library always supported this, but there wasn't a good way to express it in the command syntax. This commit also introduces considerable new functionality into cmdparser, adding a Subtree class to allow an entire parse tree to be "hidden" behind a single token in the top-level tree, including a conversion function which can squash syntax down to useful values (for example, datetimeparse uses this to convert to a datetime instance).
- Loading branch information
Showing
6 changed files
with
1,569 additions
and
606 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Oops, something went wrong.