GothenburgBitFactory / tasklib

A Python library for interacting with taskwarrior databases.
http://tasklib.readthedocs.org/en/latest/
BSD 3-Clause "New" or "Revised" License
147 stars 28 forks source link

filter() is breaking apart dot-containing '__' value part of kwarg into comma separated string? #116

Open smemsh opened 2 years ago

smemsh commented 2 years ago

hello, trying the examples from README, using taskwarrior 2.6.2 and current develop branch of tasklib:

>>> from tasklib import TaskWarrior
>>> tw = TaskWarrior()
>>> tw.tasks.pending().filter(tags__contains='testing')
[]

the strange thing is, look at the [slightly reformatted] trace:

$ sudo strace -s 999 -f -p 1752607 -e trace=execve -e status=successful
...
[pid 1753587] execve("/usr/local/bin/task", [
"task",
"rc.confirmation=no",
"rc.dependency.confirmation=no",
"rc.recurrence.confirmation=no",
"rc.json.array=off",
"rc.bulk=0",
"status:'pending'",
"tags.contains:'t,e,s,t,i,n,g'", "export"
],
0x55ba0559c100 /* 83 vars */) = 0
[pid 1753587] +++ exited with 0 +++

why is it breaking it apart into t,e,s,t,i,n,g? I have a feeling I'm doing something wrong, but can't figure out what :-) Also note that simple filters work, like

tw.tasks.pending().filter(description='the')

this translates to description:'the' which correctly matches tasks whose description starts with "the"

smemsh commented 2 years ago

ok so it wants a list if you're specifying tags, good that we can pass them, but I would propose to handle single ones also...