From b7ab8b4257278f3295d1f4f4c43d6a524a778f4b Mon Sep 17 00:00:00 2001 From: rht Date: Fri, 13 Oct 2017 13:04:43 +0200 Subject: [PATCH] slack: Add avatar and uploads records.json. --- .../integrations/slack/slackdata2zulipdata.py | 21 ++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/zulip/integrations/slack/slackdata2zulipdata.py b/zulip/integrations/slack/slackdata2zulipdata.py index a62825e..4c6cf2c 100755 --- a/zulip/integrations/slack/slackdata2zulipdata.py +++ b/zulip/integrations/slack/slackdata2zulipdata.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 import os import json import hashlib @@ -375,7 +375,7 @@ def main(slack_zip_file: str) -> None: realm['zerver_stream'] = zerver_stream realm['zerver_subscription'] = zerver_subscription realm['zerver_recipient'] = zerver_recipient - # IO + # IO realm.json realm_file = output_dir + '/realm.json' json.dump(realm, open(realm_file, 'w')) @@ -401,15 +401,26 @@ def main(slack_zip_file: str) -> None: message_json['zerver_message'] = zerver_message message_json['zerver_usermessage'] = zerver_usermessage - # IO + # IO message.json message_file = output_dir + '/message.json' json.dump(message_json, open(message_file, 'w')) - print('ls', os.listdir()) - print('pwd', os.getcwd()) + + # IO avatar records + avatar_records_file = output_dir + '/avatars/records.json' + os.makedirs(output_dir + '/avatars') + json.dump([], open(avatar_records_file, 'w')) + + # IO uploads TODO + uploads_records_file = output_dir + '/uploads/records.json' + os.makedirs(output_dir + '/uploads') + json.dump([], open(uploads_records_file, 'w')) # TODO # attachments + print('ls', os.listdir()) + print('pwd', os.getcwd()) + # remove slack dir rm_tree(slack_dir)