You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'd like to add some more complex sorting logic, it would be nice if power users could pass a python function that is used as a comparator to the program.
The text was updated successfully, but these errors were encountered:
We store data in an sqlite cache, and query that. So your function would need to write SQL to query todos.
I have some vague plans to move caching out into a separate helper, which indexes all todos and provides an API for querying. todoman would become mostly a UI on top of that.
So I'm not sure if I'd implement this right now, or wait until that happens.
This would only influence the sorting of the result though, so something like
fromfunctoolsimportcmp_to_keyfromdopy.coreimportDopy# Using dopy to get python without indentation to make it easier to specify the func in a flagdopy=Dopy()
ifflags.sort_bynotNone:
processed=dopy.preprocess(source)
defcompare(x, y):
returnexec(processed, namespace={"x": x, "y": y})
data=sorted(data, key=cmp_to_key(compare))
could work without really increasing processing time or memory footprint significantly.
I'd like to add some more complex sorting logic, it would be nice if power users could pass a python function that is used as a comparator to the program.
The text was updated successfully, but these errors were encountered: