You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ponymail.apache.org by se...@apache.org on 2017/01/13 00:19:05 UTC

incubator-ponymail git commit: Make --count work with --pretty

Repository: incubator-ponymail
Updated Branches:
  refs/heads/master 331616004 -> 1a853ca0f


Make --count work with --pretty

Project: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/commit/1a853ca0
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/tree/1a853ca0
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/diff/1a853ca0

Branch: refs/heads/master
Commit: 1a853ca0f37e4e2b34154b2ad31976985a822c13
Parents: 3316160
Author: Sebb <se...@apache.org>
Authored: Fri Jan 13 00:18:54 2017 +0000
Committer: Sebb <se...@apache.org>
Committed: Fri Jan 13 00:18:54 2017 +0000

----------------------------------------------------------------------
 CHANGELOG.md | 1 +
 tools/ll.py  | 9 ++++++---
 2 files changed, 7 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ponymail/blob/1a853ca0/CHANGELOG.md
----------------------------------------------------------------------
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 7b154b0..437a674 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -119,6 +119,7 @@
 - Always use Javascript conditional blocks (#333)
 - links in stats pane don't set up the correct date range (#106)
 - code should delete scroll id after use (#336)
+- ll.py - Make --count work with --pretty
 
 ## CHANGES in 0.9b:
 

http://git-wip-us.apache.org/repos/asf/incubator-ponymail/blob/1a853ca0/tools/ll.py
----------------------------------------------------------------------
diff --git a/tools/ll.py b/tools/ll.py
index 9929f10..1064c7c 100755
--- a/tools/ll.py
+++ b/tools/ll.py
@@ -106,8 +106,8 @@ else:
         if pretty:
             if domain['key'].find(".") != -1:
                 l, d = domain['key'].strip("<>").split(".", 1)
-                plist[d] = plist[d] if d in plist else []
-                plist[d].append(l)
+                plist[d] = plist[d] if d in plist else {}
+                plist[d][l]=domain['doc_count']
         else:
             if args.counts:
                 print(domain['key'],domain['doc_count'])
@@ -116,5 +116,8 @@ else:
     
     for dom in sorted(plist):
         for ln in sorted(plist[dom]):
-            print("%s@%s" % (ln, dom))
+            if args.counts:
+                print("%s@%s %d" % (ln, dom, plist[dom][ln]))
+            else:
+                print("%s@%s" % (ln, dom))
             
\ No newline at end of file