Context: I want to set all my tasks to priority none, so something like:
for i in $(todoman list | sed 's/^ \+//' | cut -d' ' -f1); do
todoman edit --priority=none $i
done
The problem is, the todoman edit command runs in interactive mode.
I believe the fix is actually really simple:
diff --git i/todoman/cli.py w/todoman/cli.py
index c6aa6ea..5989df6 100644
--- i/todoman/cli.py
+++ w/todoman/cli.py
@@ -412,7 +412,7 @@ def edit(ctx, id, todo_properties, interactive, raw):
changes = False
for key, value in todo_properties.items():
- if value:
+ if value is not None:
changes = True
setattr(todo, key, value)
When priority is set to "none", the corresponding value in the todo_properties dict is 0, which is evaluated to False. Checking against None fixes it. The code right after that checks for changes and sets interactive mode if it's False.
I'd make a PR but I couldn't set up a development environment, setup.py gave me an error (apparently because of Debian's version format?), and I didn't want to spend too much time on this at the moment. So I couldn't run (and hence write) tests.
Context: I want to set all my tasks to priority none, so something like:
The problem is, the
todoman edit
command runs in interactive mode.I believe the fix is actually really simple:
When priority is set to "none", the corresponding value in the
todo_properties
dict is 0, which is evaluated to False. Checking against None fixes it. The code right after that checks forchanges
and sets interactive mode if it's False.I'd make a PR but I couldn't set up a development environment, setup.py gave me an error (apparently because of Debian's version format?), and I didn't want to spend too much time on this at the moment. So I couldn't run (and hence write) tests.