From 8c4a36791f1bcf7001d27eca7b51d69f21e8a0d1 Mon Sep 17 00:00:00 2001 From: decentral1se Date: Wed, 6 Apr 2022 09:44:19 +0200 Subject: [PATCH] autoformatter says change this so i change --- lumbunglib/hashtag.py | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/lumbunglib/hashtag.py b/lumbunglib/hashtag.py index 2d46e0e..baf21c9 100644 --- a/lumbunglib/hashtag.py +++ b/lumbunglib/hashtag.py @@ -28,8 +28,7 @@ hashtags = [ def login_mastodon_bot(): mastodon = Mastodon( - access_token=os.environ.get("MASTODON_AUTH_TOKEN"), - api_base_url = instance + access_token=os.environ.get("MASTODON_AUTH_TOKEN"), api_base_url=instance ) return mastodon @@ -73,9 +72,9 @@ def create_post(post_directory, post_metadata): template_dir = os.path.join(Path(__file__).parent.resolve(), "templates") env = jinja2.Environment(loader=jinja2.FileSystemLoader(template_dir)) - name = post_metadata['account']['display_name'] + name = post_metadata["account"]["display_name"] name = sub('"', '\\"', name) - post_metadata['account']['display_name'] = name + post_metadata["account"]["display_name"] = name env.filters["localize_media_url"] = localize_media_url env.filters["filter_mastodon_urls"] = filter_mastodon_urls @@ -140,7 +139,10 @@ def main(): create_post(post_dir, post_metadata) all_existing_posts.append(str(post_metadata["id"])) else: - print("not pulling post %s (post is local only)" % (post_metadata["id"])) + print( + "not pulling post %s (post is local only)" + % (post_metadata["id"]) + ) # if we already have the post do nothing, possibly update elif str(post_metadata["id"]) in existing_posts: @@ -149,7 +151,10 @@ def main(): str(post_metadata["id"]) ) # create list of posts which have not been returned in the feed elif str(post_metadata["id"]) in all_existing_posts: - print("skipping post %s as it was already pulled with a different hashtag." % (str(post_metadata["id"]))) + print( + "skipping post %s as it was already pulled with a different hashtag." + % (str(post_metadata["id"])) + ) for post in existing_posts: print(