diff options
author | Daniel Thompson <daniel.thompson@linaro.org> | 2018-10-10 16:00:34 +0100 |
---|---|---|
committer | Daniel Thompson <daniel.thompson@linaro.org> | 2018-10-10 16:00:34 +0100 |
commit | 717761a6382b9f15de3d95789a5394e7fd7bbf73 (patch) | |
tree | a572f264ee4e7aa1b724e5b78ef35e2c22f7f6c2 | |
parent | d099b943657713c5d5e5423e5474e0731af30df7 (diff) |
96btool: filter: Allow filtering by usermap
-rwxr-xr-x | bin/96btool | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/bin/96btool b/bin/96btool index ebb30d1..7022254 100755 --- a/bin/96btool +++ b/bin/96btool @@ -411,6 +411,12 @@ def do_filter(args): users = args.user.split(',') posts = [ p for p in posts if p['username'] in users ] + if args.usermap: + (usermap, needle) = args.usermap.split(',', maxsplit=1) + with open(usermap, 'r') as f: + usermap = ujson.load(f) + posts = [ p for p in posts if p['username'] in usermap + and needle in usermap[p['username']] ] if args.first_post: # Opps. We stripped out the post stream so this test ends up more @@ -875,6 +881,7 @@ def main(argv): s.add_argument("--until", default="tomorrow", help="When to stop gathering .information") s.add_argument("--user", help="Select only posts by this user") + s.add_argument('--usermap', help='Select posts using a lookup table') s = new_parser(do_format) s.add_argument("--template", |