Coder Social home page Coder Social logo

due's People

Contributors

adrianheine avatar darrenldl avatar ddffnn avatar juliendelplanque avatar rebecca-owen avatar rebeccamorgan avatar swinslow avatar tommyku avatar vozeldr avatar zoechrome avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

due's Issues

Skip completed tasks from listing?

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

All tasks appear as overdue

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.

use default coloring (feature request)

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):

Screen Shot 2021-01-29 at 1 35 39 PM

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.

Priority Colors Lost

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.

Possible Bug: Using `todo.sh due` along with ANSI color codes seems to break the first code

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!

on ubuntu 20.04 python is not available

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,

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.