diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2021-08-10 04:22:29 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2021-08-10 04:22:29 -0700 |
commit | f09ee2aa19922e7416ee85d376e60f3e03c860ef (patch) | |
tree | 05b354c85919cbe2676f325c56bc13338f90afe7 | |
parent | 58c62538ea659dba981622be80b79e69251d2884 (diff) | |
download | mu-f09ee2aa19922e7416ee85d376e60f3e03c860ef.tar.gz |
.
-rw-r--r-- | browse_slack/convert_slack.py | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/browse_slack/convert_slack.py b/browse_slack/convert_slack.py index 670f43c5..a1a91278 100644 --- a/browse_slack/convert_slack.py +++ b/browse_slack/convert_slack.py @@ -43,13 +43,11 @@ def look_up_ppm_image(url): user_id = {} # name -> index with open('users.json') as f: - length = 0 - for user in json.load(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']] = length - length += 1 + user_id[user['id']] = idx items = [] |