Created
August 17, 2011 14:24
-
-
Save YANOUSHek/1151618 to your computer and use it in GitHub Desktop.
t sort by task's text
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- a/t.py Mon May 09 21:22:15 2011 -0400 | |
+++ b/t.py Wed Aug 17 16:23:46 2011 +0200 | |
@@ -202,7 +202,7 @@ | |
tasks[task_id]['prefix'] = prefix | |
plen = max(map(lambda t: len(t[label]), tasks.values())) if tasks else 0 | |
- for _, task in sorted(tasks.items()): | |
+ for _, task in sorted(tasks.items(), key=lambda t: t[1]['text'].lower()): | |
if grep.lower() in task['text'].lower(): | |
p = '%s - ' % task[label].ljust(plen) if not quiet else '' | |
print p + task['text'] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment