diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2021-08-10 04:55:19 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2021-08-10 04:55:19 -0700 |
commit | 49352e16164e34a329193cc49d5b121fbbd7b529 (patch) | |
tree | 9ba2f7534b3578d4137a094af426da9ec180da19 | |
parent | 7f972dfc7c433bd0a3cf4a93c8c62bbb392d69b5 (diff) | |
download | mu-49352e16164e34a329193cc49d5b121fbbd7b529.tar.gz |
.
-rw-r--r-- | browse_slack/convert_slack.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/browse_slack/convert_slack.py b/browse_slack/convert_slack.py index b3ac3f92..a19717cc 100644 --- a/browse_slack/convert_slack.py +++ b/browse_slack/convert_slack.py @@ -39,16 +39,16 @@ def look_up_ppm_image(url): with open(filename) as f: return f.read() -user_id = {} # name -> index +user_idx = {} with open('users.json') as f: for idx, user in enumerate(json.load(f)): if 'real_name' not in user: user['real_name'] = '' print(f"({json.dumps(user['id'])} \"@{user['name']}\" {json.dumps(user['real_name'])} [{look_up_ppm_image(user['profile']['image_72']) or ''}])") - user_id[user['id']] = idx + user_idx[user['id']] = idx def by(item): - return user_id[item['user']] + return user_idx[item['user']] for channel in json.load(open('channels.json')): for filename in sorted(listdir(channel['name'])): |