diff options
author | Daniel Thompson <daniel.thompson@linaro.org> | 2018-02-28 21:30:10 +0000 |
---|---|---|
committer | Daniel Thompson <daniel.thompson@linaro.org> | 2018-02-28 21:30:10 +0000 |
commit | 1d017ead1c5d65f4a7a8738643e64bc0b8f0c554 (patch) | |
tree | b2f8fdae5e724acc50aa474eadf69689992c95d4 | |
parent | 913b1e978dc04dc7bd1e28064edb061a4e595ef7 (diff) |
96btool: Add usermap command
-rwxr-xr-x | bin/96btool | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/bin/96btool b/bin/96btool index bff847a..ea0f854 100755 --- a/bin/96btool +++ b/bin/96btool @@ -679,6 +679,21 @@ def do_tag(args): json.dump(posts, sys.stdout, indent=2) +def do_usermap(args): + '''Generate a usermap''' + if not args.json: + lines = sys.stdin.readlines() + else: + with open(args.json, 'r') as f: + lines = f.readlines() + + usermap = {} + for ln in lines: + fields = ln.strip().split() + usermap[fields[0]] = fields[1] + + json.dump(usermap, sys.stdout, indent=2) + def do_weekly(args): '''Generate a detailed weekly activity report''' wrappers = ( @@ -845,6 +860,8 @@ def main(argv): s.add_argument('json', nargs='?', help='Read data from this file') + s = new_parser(do_usermap) + s = new_parser(do_weekly) s.add_argument('json', nargs='?', help='Read data from this file') |