diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2021-08-10 04:34:58 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2021-08-10 04:34:58 -0700 |
commit | 98b11ea64566199698991bf58e1037f4711e2e88 (patch) | |
tree | 420248bd024616b2e53a838dd5136d4cc9074a93 /browse_slack/convert_slack.py | |
parent | 34aba8e6c6f6e85c8a5e9157e1094f162de4932b (diff) | |
download | mu-98b11ea64566199698991bf58e1037f4711e2e88.tar.gz |
.
Diffstat (limited to 'browse_slack/convert_slack.py')
-rw-r--r-- | browse_slack/convert_slack.py | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/browse_slack/convert_slack.py b/browse_slack/convert_slack.py index 13604e9f..460c4a31 100644 --- a/browse_slack/convert_slack.py +++ b/browse_slack/convert_slack.py @@ -70,11 +70,7 @@ def contents(filename): except KeyError: stderr.write(repr(item)+'\n') -def filenames(dir): - for filename in sorted(listdir(dir)): - yield join(dir, filename) - for channel in json.load(open('channels.json')): - for filename in filenames(channel['name']): - for item in contents(filename): + for filename in sorted(listdir(channel['name'])): + for item in contents(join(channel['name'], filename)): print(f"({json.dumps(item['name'])} {json.dumps(channel['name'])} {item['by']} {json.dumps(item['contents'])})") |