diff options
-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 = [] |