From 98b11ea64566199698991bf58e1037f4711e2e88 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Tue, 10 Aug 2021 04:34:58 -0700 Subject: . --- browse_slack/convert_slack.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'browse_slack') 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'])})") -- cgit 1.4.1-2-gfad0