-
Notifications
You must be signed in to change notification settings - Fork 10
Legacy information
This page tries to collect information about all those assumptions, specifications and design decisions not actually documented in the original legacy hamster-cli to help our goal of creating an API compatible release.
Also, it may be that arguments specified as [start-time] [end-time]
actually mean [start-time [end-time]]
.
Needs confirmation!
We actually have to situations where we parse times.
- When a
raw_fact
is parsed its start and endtime information is extracted. - client functions (for example in hamster_cli) may allow explicit time(range?) information as a string that needs to be parsed.
Both sets of information may be present at the same time. For example when
hamster_cli start
is called with an 'activity' that contains time information as well as additional start/end arguments.
The original Fact
constructor handles parsing of implicit time information. If in addition to that explicit time info (for example from the initiating client command) is provided, it overrides implicit information.
It is worth mentioning that time-info mentioned by legacy --help
refers to a single datetime-point. In contrast out undocumented but clearly present time-info for list and the like is actually one timerange-string.
Bot need different handling/parsing.
Timeinfo of a raw_fact
can take one of the following three forms:
- Duration:
-
- Time:
HH:MM
- Timerange
HH:MM-HH:MM
(Note: only only timeranges, not date(time)-ranges are allowed)
start <activity> [start-time] [end-time]
: Track an activity
Args:
- start-time (str): Start time, optional.
- end-time (str): End time, optional.
Returns:
- Nothing
see start
. Alias command.
stop
: Stop tracking current activity.
list [start-time] [end-time]
: List activities
- __list collects the facts. For that it passes start/end datetimes. However the following __get_facts only deals with dates. Seems strange.
search [terms] [start-time] [end-time]
: List activities matching a search term.
-
term
is matched againstactivity.name
,category.name
andtag.name
export [html|tsv|ical|xml] [start-time] [end-time]
: Export activities with the specified format.
current
: Print current activity
activities
: List all the activities names, one per line.
legacy code
actually has two functions
-
_activities
: never actually used! wat! - allows for a search parameter with syntax:
[email protected]
- however, actual code block is most bizzare...
-
activities
: this is the one actually reference in the "API"/help. - takes a
search
argument, however, this gets passed on the thestorage
method without further work. as a consequence there is no notion of filter by category as far as we can tell.
Search:
- syntax:
categories
: List all the categories names, one per line.
overview
: Launch overview window of th GTK client.
statistics
: Launch statistics window of the GTK client.
about
: Launch about window of the GTK client.
Please note: This seems to be different (more extensive) than the the original backend time parsing code. Needs confirmation!
YYYY-MM-DD hh:mm:ss
- If
date
is missing, it will default to today! - If
time
is missing, it will default to 00:00 for start time and 23:59 for end time.
-minutes
- Relative time in minutes from the current date and time.