From 9057656365533ca650459751c28682e9d93795f2 Mon Sep 17 00:00:00 2001 From: Manuel Ebert Date: Thu, 10 May 2012 11:27:02 +0200 Subject: [PATCH] Formatted tag count line --- jrnl.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/jrnl.py b/jrnl.py index fccb0cc1..6da09640 100755 --- a/jrnl.py +++ b/jrnl.py @@ -459,7 +459,10 @@ if __name__ == "__main__": elif args.tags: # get all tags # Astute reader: should the following line leave you as puzzled as me the first time # I came across this construction, worry not and embrace the ensuing moment of enlightment. - tags = [tag for entry in journal.entries for tag in set(entry.tags)] + tags = [tag + for entry in journal.entries + for tag in set(entry.tags) + ] # To be read: [for entry in journal.entries: for tag in set(entry.tags): tag] tag_counts = {(tags.count(tag), tag) for tag in tags} for n, tag in sorted(tag_counts, reverse=True):