Replace save with function

main
bashrc 2026-04-25 17:35:34 +01:00
parent dc1085e1dd
commit 61b4d8d5c1
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 session import post_json
from webfinger import webfinger_handle from webfinger import webfinger_handle
from auth import create_basic_auth_header from auth import create_basic_auth_header
from data import save_string
def no_of_announces(post_json_object: {}) -> int: 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): if os.path.isfile(seen_filename):
return return
announce_id = remove_id_ending(message_json['id']) announce_id = remove_id_ending(message_json['id'])
try: save_string(announce_id, seen_filename,
with open(seen_filename, 'w+', encoding='utf-8') as fp_seen: 'EX: mark_announce_as_seen unable to write ' + seen_filename)
fp_seen.write(announce_id)
except OSError:
print('EX: mark_announce_as_seen unable to write ' + seen_filename)
def undo_announce_collection_entry(recent_posts_cache: {}, def undo_announce_collection_entry(recent_posts_cache: {},