From 14bbce808a8bf2b7d98a2b13d525d4c55f9fc963 Mon Sep 17 00:00:00 2001 From: tonyrewin Date: Mon, 5 Sep 2022 10:18:56 +0300 Subject: [PATCH] fmtfix --- migration/export.py | 37 ++++++++----------------------------- 1 file changed, 8 insertions(+), 29 deletions(-) diff --git a/migration/export.py b/migration/export.py index e8f28b58..37e01099 100644 --- a/migration/export.py +++ b/migration/export.py @@ -67,39 +67,22 @@ def export_slug(slug, storage): def export_email_subscriptions(): - email_subscriptions_data = json.loads( - open("migration/data/email_subscriptions.json").read() - ) + email_subscriptions_data = json.loads(open("migration/data/email_subscriptions.json").read()) for data in email_subscriptions_data: + # TODO: migrate to mailgun list manually # migrate_email_subscription(data) pass - print( - "[migration] " - + str(len(email_subscriptions_data)) - + " email subscriptions exported" - ) + print("[migration] " + str(len(email_subscriptions_data)) + " email subscriptions exported") def export_shouts(storage): # update what was just migrated or load json again if len(storage["users"]["by_slugs"].keys()) == 0: - storage["users"]["by_slugs"] = json.loads( - open(EXPORT_DEST + "authors.json").read() - ) - print( - "[migration] " - + str(len(storage["users"]["by_slugs"].keys())) - + " exported authors " - ) + storage["users"]["by_slugs"] = json.loads(open(EXPORT_DEST + "authors.json").read()) + print("[migration] " + str(len(storage["users"]["by_slugs"].keys())) + " exported authors ") if len(storage["shouts"]["by_slugs"].keys()) == 0: - storage["shouts"]["by_slugs"] = json.loads( - open(EXPORT_DEST + "articles.json").read() - ) - print( - "[migration] " - + str(len(storage["shouts"]["by_slugs"].keys())) - + " exported articles " - ) + storage["shouts"]["by_slugs"] = json.loads(open(EXPORT_DEST + "articles.json").read()) + print("[migration] " + str(len(storage["shouts"]["by_slugs"].keys())) + " exported articles ") for slug in storage["shouts"]["by_slugs"].keys(): export_slug(slug, storage) @@ -147,8 +130,4 @@ def export_json( ensure_ascii=False, ) ) - print( - "[migration] " - + str(len(export_comments.items())) - + " exported articles with comments" - ) + print("[migration] " + str(len(export_comments.items())) + " exported articles with comments")