Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correctly handles custom priorities #304

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

nkakouros
Copy link
Contributor

This solves #275.

It reads taskwarrior configuration and extracts the priorities from there (for instance, 0,L,,M,H, which treats L as lower priority that ''). The 'no priority' level is the empty priority (priority:). Priorities left of that are considered as insignificance indicators (and are shown with ¡, the reverse of !) and priorities right of the 'no-priority' are considered higher (and are shown as !, as is the case currently). For example:

0 -> Very Insignificant issue (¡¡)
L -> Insignificant issue (¡)
'' -> normal issue ()
M -> prioritize more (!)
H -> always come first (!!)

Of course, the above is just an example, the user can set the taskwarrior setting uda.priority.values to a sequence of characters so as to customize the exact behavior. In taskwarrior, it is the coefficient of a priority that matters and not the position of the the priority in uda.priority.values. This leaves the uda.priority.values settings free for the user to set in a way that the above markers (¡ and !) make sense to them.

I am also thinking of adding a configuration option to set custom markers (instead of ¡ and !).

One TODO is to highlight the (arbitrary) priority markers correctly, instead of only the !, !!, !!! cases.

@ghost
Copy link

ghost commented Nov 22, 2020

Priority is UDA, which means one can even make it a float (like I have done).

I want to point out that a correct implementation of custom priorities should be included. As of writing, without this implementation, taskwiki fails silently.

tw.overrides.update({'context':''})

# Read urgency levels once instead of at every task processing.
_urgency_levels = tw.config.get("uda.priority.values") or "H,M,L,"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd argue urgency_levels is not a fortunate name here, as urgency already has a meaning in TW ecosystem which is distinct from priority.

@@ -17,7 +17,7 @@
DUE = r'(?P<due>{0})'.format(DUE_UNNAMED)
TEXT = r'(?P<text>.+?)'
COMPLETION_MARK = r'(?P<completed>.)'
PRIORITY = r'(?P<priority>!{1,3})'
PRIORITY = r'(?P<priority>!+|¡+)'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not a big fan of the reversed exclamation mark - while it really does look cool, it is not straightforward to type on the keyboard. I'm wondering if there is not a different symbol we could use that would naturally convey the meaning of lower priority.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants