rebecca-owen / due Goto Github PK
View Code? Open in Web Editor NEWA todo.txt plugin to display your due and overdue tasks
License: MIT License
A todo.txt plugin to display your due and overdue tasks
License: MIT License
As the title says, for every due date, sort the tasks due by priority, I think this could come in handy :)
This seems like a good idea to me, but is it? I have applied it on my clone, so I leave a patch here in case anyone wants to try it out. Its trivial though.
diff --git a/due.py b/due.py
index c0fc26a..e04b5c0 100644
--- a/due.py
+++ b/due.py
@@ -52,6 +52,10 @@ def main(todo_file, future_days=0):
key = os.getenv("TODO_TXT_DUE_KEY", "due")
for i, task in enumerate(content):
+
+ # skip completed tasks
+ if task[0] == "x": continue
+
match = re.findall(
r"(\([A-Z]\))?[A-Za-z0-9+@\s]+%s:(\d{4}-\d{2}-\d{2})" % key, task
)
@@ -61,7 +65,7 @@ def main(todo_file, future_days=0):
tasks_with_date.append((i, task, date, match[0][0]))
# Sort tasks that match due: regex by date, then priority
- sorted_tasks = sorted(tasks_with_date, key=lambda tup: (tup[2], tup[3]))
+ sorted_tasks = sorted(tasks_with_date, key=lambda tup: (tup[2], tup[1]))
zero_pad = int(math.log10(len(content))) + 1
# Append to relevant lists for output
When I run todo.sh due
, all of the tasks (1 due today, the rest due in the future) appear as Overdue tasks
. See example output:
Overdue tasks:
1 TODO example A due:2020-04-19
3 TODO example B due:2020-04-20
4 TODO example C due:2020-04-21
Any ideas? Not sure how to debug this.
Hi,
It would be nice if due
used the standard todo.sh
coloring, rather than its own (which seems to just highlight priorities).
Current behavior (td
is my alias):
Note that td due
listing is plain white, which is the default. My desired behavior is the items are colored identically in both cases.
Thanks for this plugin; it's very useful to me.
Perhaps with an optional flag
When I issue the command t ls
, the prioritized tasks are colored in the terminal.
When I issue the command t due
, the prioritized tasks are no colored.
It would be nice if the coloring was not "lost" when using due to filter.
e.g. todo.sh due chg # line
Perhaps using cal?
e.g. todo.sh add date 'tue', '4wk tue', 'last tue','today','tomorrow'
Hello,
I am seeing something along the lines of 033[1m39 (A) Map out tasks for upcoming evaluation
in all of my tasks when using todo.sh due
. Here is how to recreate this issue:
In .config/todo/config
:
export BOLD="\\033[1m"
export BLACK="\\033[30m"
export RED_BG="\\033[41m"
export PRI_A="$BOLD$BLACK$RED_BG"
The $BLACK$RED_BG
codes are working fine and formatting correctly, but the $BOLD
code seems to have been clipped.
Changing line 34 in due.py from:
color = eval('u"' + color[1:] + '"')
to:
color = eval('u"' + color[0:] + '"')
Seems to fix this for me. I'm sorry but I am not sure how to properly submit a pull request yet. I hope this helps anyone else!
Hi!
When I run todo.sh due I'm getting the following error:
/home/julian/todo.txt_cli/todo.sh: line 878: /home/julian/.todo.actions.d/due: Is a directory
I think the clone command needs a dot at the end so it doesn't create a new directory:
git clone https://github.com/rebeccamorgan/due.git .
Hi there,
on ubuntu 20.4
$ python
is not available. Fixed it with this...
#!/usr/bin/env bash
action=$1
flag=$2
python=/usr/bin/python3 # python is no longer awailable on Ubuntu 20.04
shift
[ "$action" = "usage" ] && {
echo " Visualize tasks by due date:"
echo " due"
echo " default behaviour generates a list tasks due today or overdue"
echo " Optional argument (integer n) also shows tasks due in next n days."
echo ""
exit
}
[ "$action" = "due" ] && {
$python $(dirname $0)/due.py "$TODO_FILE" $flag
}
I don not know if this is clever or not, but it works works for me,
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.