Replace save with function

main
bashrc 2026-04-25 17:35:34 +01:00
parent 7f1d17f717
commit ef09a54061
1 changed files with 3 additions and 5 deletions

View File

@ -40,6 +40,7 @@ from posts import get_person_box
from session import post_json
from webfinger import webfinger_handle
from auth import create_basic_auth_header
from data import save_string
def no_of_announces(post_json_object: {}) -> int:
@ -565,11 +566,8 @@ def mark_announce_as_seen(base_dir: str, nickname: str, domain: str,
if os.path.isfile(seen_filename):
return
announce_id = remove_id_ending(message_json['id'])
try:
with open(seen_filename, 'w+', encoding='utf-8') as fp_seen:
fp_seen.write(announce_id)
except OSError:
print('EX: mark_announce_as_seen unable to write ' + seen_filename)
save_string(announce_id, seen_filename,
'EX: mark_announce_as_seen unable to write ' + seen_filename)
def undo_announce_collection_entry(recent_posts_cache: {},