aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Thompson <daniel.thompson@linaro.org>2018-02-12 15:34:52 +0000
committerDaniel Thompson <daniel.thompson@linaro.org>2018-02-12 15:34:52 +0000
commit43dc6be06ce400ea8a26cca54d6a78b7a603f9cc (patch)
treeef6948a5e31b56d571c196716164d403f45a693a
parent216b508c398755b4196d339fbfdecce73ef9bf8e (diff)
96btool: Include total post count in a weekly report
-rwxr-xr-xbin/96btool9
1 files changed, 4 insertions, 5 deletions
diff --git a/bin/96btool b/bin/96btool
index d8bef5d..01c75e0 100755
--- a/bin/96btool
+++ b/bin/96btool
@@ -627,15 +627,14 @@ def do_weekly(args):
textwrap.TextWrapper(initial_indent=' - ', subsequent_indent=' ')
)
- def wrap(msg, level=1):
+ def wrap(msg, level):
print('\n'.join(wrappers[level].wrap(msg)))
- wrap("96Boards forum activity", level=1)
+ posts = Post.load(args.json)
- summary = collections.defaultdict(int)
- for p in Post.load(args.json):
- summary[p['topic']['title']] += 1
+ wrap('96Boards forum activity ({} posts)'.format(len(posts)), level=1)
+ summary = collect.accumulate(posts, lambda p: p['topic']['title'])
for s in sorted(summary.keys()):
if summary[s] == 1:
wrap(s, level=2)