From cfd017158b0e2d3b606bcb7eb1773d649b45e7b4 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Thu, 11 Jul 2024 15:02:03 +0100 Subject: [PATCH] Tidying --- follow.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/follow.py b/follow.py index 5affef348..10d6b1bbc 100644 --- a/follow.py +++ b/follow.py @@ -82,14 +82,15 @@ def create_initial_last_seen(base_dir: str, http_prefix: str) -> None: actor = local_actor_url(http_prefix, nickname, domain) last_seen_filename = \ last_seen_dir + '/' + actor.replace('/', '#') + '.txt' - if not os.path.isfile(last_seen_filename): - try: - with open(last_seen_filename, 'w+', - encoding='utf-8') as fp_last: - fp_last.write(str(100)) - except OSError: - print('EX: create_initial_last_seen 2 ' + - last_seen_filename) + if os.path.isfile(last_seen_filename): + continue + try: + with open(last_seen_filename, 'w+', + encoding='utf-8') as fp_last: + fp_last.write(str(100)) + except OSError: + print('EX: create_initial_last_seen 2 ' + + last_seen_filename) break