From 7d9556b8d455b00d8b79c4c0cc10345ef302accd Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sat, 31 May 2025 15:37:11 +0100 Subject: [PATCH] Less indentation --- posts.py | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/posts.py b/posts.py index 242bec5ca..8754d3a1f 100644 --- a/posts.py +++ b/posts.py @@ -6115,21 +6115,23 @@ def populate_replies_json(base_dir: str, nickname: str, domain: str, def _reject_announce(announce_filename: str, base_dir: str, nickname: str, domain: str, announce_post_id: str, recent_posts_cache: {}, - debug: bool): + debug: bool) -> None: """Marks an announce as rejected """ reject_post_id(base_dir, nickname, domain, announce_post_id, recent_posts_cache, debug) # reject the post referenced by the announce activity object - if not os.path.isfile(announce_filename + '.reject'): - try: - with open(announce_filename + '.reject', 'w+', - encoding='utf-8') as fp_reject_announce: - fp_reject_announce.write('\n') - except OSError: - print('EX: _reject_announce unable to write ' + - announce_filename + '.reject') + if os.path.isfile(announce_filename + '.reject'): + return + + try: + with open(announce_filename + '.reject', 'w+', + encoding='utf-8') as fp_reject_announce: + fp_reject_announce.write('\n') + except OSError: + print('EX: _reject_announce unable to write ' + + announce_filename + '.reject') def download_announce(session, base_dir: str, http_prefix: str,