greatday.spells module

Contains custom magodo Todo spells used by greatday.

add_o_prefix(line)[source]

Adds the ‘o ‘ prefix to the Todo line.

Parameters

line (str) –

Return type

str

add_x_prefix(line)[source]

Adds the ‘x:HHMM ‘ prefix to the Todo line (when done).

Parameters

line (str) –

Return type

str

appt_todos(todo)[source]

Adds priority of (C) or (T) to todos with an appt:HHMM tag.

Parameters

todo (TypeVar(T, bound= AbstractTodo)) –

Return type

TypeVar(T, bound= AbstractTodo)

due_context_spell(todo)[source]

Converts @due context into ‘due’ metatag.

Parameters

todo (TypeVar(T, bound= AbstractTodo)) –

Return type

TypeVar(T, bound= AbstractTodo)

group_tags(todo)[source]

Spell that organizes Todo tags by grouping them at the end.

Groups all #epics, @ctxs, +projs, and meta:data at the end of the line.

Parameters

todo (TypeVar(T, bound= AbstractTodo)) –

Return type

TypeVar(T, bound= AbstractTodo)

inbox_spell(todo)[source]

Converts @i into @INBOX.

Parameters

todo (TypeVar(T, bound= AbstractTodo)) –

Return type

TypeVar(T, bound= AbstractTodo)

remove_o_prefix(line)[source]

Removes the ‘o ‘ prefix from the Todo line.

Parameters

line (str) –

Return type

str

remove_priorities(todo)[source]

Remove priorities for done todos.

Parameters

todo (TypeVar(T, bound= AbstractTodo)) –

Return type

TypeVar(T, bound= AbstractTodo)

remove_x_prefix(line)[source]

Removes the ‘x:HHMM ‘ prefix from the Todo line.

Parameters

line (str) –

Return type

str

render_relative_dates(todo)[source]

Renders metatags that support relative dates.

(e.g. ‘due:1d’ -> ‘due:2022-02-16’)

Parameters

todo (TypeVar(T, bound= AbstractTodo)) –

Return type

TypeVar(T, bound= AbstractTodo)

reopen_if_closed(todo)[source]

Re-opens a closed todo.

Parameters

todo (TypeVar(T, bound= AbstractTodo)) –

Return type

TypeVar(T, bound= AbstractTodo)

reopen_todo_spell(todo)[source]

Spell that re-opens todos when the ‘@x’ context is found.

Parameters

todo (TypeVar(T, bound= AbstractTodo)) –

Return type

TypeVar(T, bound= AbstractTodo)

scope_spell(todo)[source]

Spell that handles @w/@m/@q/@y/@o/@t/@s contexts.

Adds appropriate ‘scope’ metatag and ‘due’ date.

Parameters

todo (TypeVar(T, bound= AbstractTodo)) –

Return type

TypeVar(T, bound= AbstractTodo)

snooze_spell(todo)[source]

Handles the ‘snooze’ metadata tag.

Parameters

todo (TypeVar(T, bound= AbstractTodo)) –

Return type

TypeVar(T, bound= AbstractTodo)

x_points(todo)[source]

Handles metatags of the form ‘x:N’ at the start of a todo line.

Parameters

todo (TypeVar(T, bound= AbstractTodo)) –

Return type

TypeVar(T, bound= AbstractTodo)