From 4c69380348c1fed51c0464f94f2e09cc5868aea1 Mon Sep 17 00:00:00 2001 From: bashrc Date: Mon, 27 Apr 2026 16:28:20 +0100 Subject: [PATCH] List types --- blocking.py | 2 +- blog.py | 6 +++--- city.py | 2 +- content.py | 2 +- daemon.py | 12 ++++++------ epicyon.py | 8 ++++---- inbox.py | 2 +- maps.py | 2 +- webapp_calendar.py | 2 +- webapp_hashtagswarm.py | 2 +- 10 files changed, 20 insertions(+), 20 deletions(-) diff --git a/blocking.py b/blocking.py index 2aed4fee6..5ce5eef01 100644 --- a/blocking.py +++ b/blocking.py @@ -714,7 +714,7 @@ def is_blocked_nickname(base_dir: str, nickname: str, if not blocked_cache: # instance-wide block list - blocked_cache = [] + blocked_cache: list[str] = [] global_blocking_filename = data_dir(base_dir) + '/blocking.txt' if os.path.isfile(global_blocking_filename): blocked_cache_str = \ diff --git a/blog.py b/blog.py index 34b795e00..12db0d4b7 100644 --- a/blog.py +++ b/blog.py @@ -667,7 +667,7 @@ def html_blog_page(authorized: bool, session, css_filename = base_dir + '/epicyon.css' instance_title = \ get_config_param(base_dir, 'instanceTitle') - preload_images = [] + preload_images: list[str] = [] blog_str = \ html_header_with_external_style(css_filename, instance_title, None, preload_images) @@ -873,7 +873,7 @@ def html_blog_view(authorized: bool, css_filename = base_dir + '/epicyon.css' instance_title = \ get_config_param(base_dir, 'instanceTitle') - preload_images = [] + preload_images: list[str] = [] blog_str = \ html_header_with_external_style(css_filename, instance_title, None, preload_images) @@ -986,7 +986,7 @@ def html_edit_blog(media_instance: bool, translate: {}, instance_title = \ get_config_param(base_dir, 'instanceTitle') - preload_images = [] + preload_images: list[str] = [] edit_blog_form = \ html_header_with_external_style(css_filename, instance_title, None, preload_images) diff --git a/city.py b/city.py index a854e97d5..5ba54c321 100644 --- a/city.py +++ b/city.py @@ -237,7 +237,7 @@ def spoof_geolocation(base_dir: str, if cities_str: cities = cities_str.split('\n') - nogo = [] + nogo: list[list] = [] if nogo_list: nogo = nogo_list else: diff --git a/content.py b/content.py index 955fc50c3..c3977e6d8 100644 --- a/content.py +++ b/content.py @@ -1511,7 +1511,7 @@ def add_html_tags(base_dir: str, http_prefix: str, long_words_list: list[str] = [] prev_word_str: str = '' auto_tags_list = _load_auto_tags(base_dir, nickname, domain) - append_tags = [] + append_tags: list[str] = [] for word_str in words: word_len = len(word_str) if word_len <= 2: diff --git a/daemon.py b/daemon.py index 23398b1b5..ed97c315f 100644 --- a/daemon.py +++ b/daemon.py @@ -431,7 +431,7 @@ class EpicyonServer(ThreadingHTTPServer): received_message: bool = False inbox_queue: list[dict] = [] send_threads = None - post_log = [] + post_log: list[str] = [] max_queue_length = 64 allow_deletion: bool = True last_login_time = 0 @@ -443,7 +443,7 @@ class EpicyonServer(ThreadingHTTPServer): tokens_lookup = {} instance_only_skills_search: bool = True followers_threads = [] - blocked_cache = [] + blocked_cache: list[str] = [] blocked_cache_last_updated = 0 blocked_cache_update_secs = 120 blocked_cache_last_updated = 0 @@ -468,7 +468,7 @@ class EpicyonServer(ThreadingHTTPServer): fontsCache = {} shared_item_federation_tokens = None shared_item_federation_tokens = None - peertube_instances = [] + peertube_instances: list[str] = [] max_mentions = 10 max_emoji = 10 max_hashtags = 10 @@ -491,16 +491,16 @@ class EpicyonServer(ThreadingHTTPServer): instance_description_short: str = 'Epicyon' robots_txt = None last_llm_time = None - mitm_servers = [] + mitm_servers: list[str] = [] log_unknown_requests: bool = False watermark_width_percent = 0 watermark_position = 0 watermark_opacity = 0 headers_catalog = {} - dictionary = [] + dictionary: list[str] = [] twograms = {} searchable_by_default = {} - known_epicyon_instances = [] + known_epicyon_instances: list[str] = [] def handle_error(self, request, client_address): # surpress connection reset errors diff --git a/epicyon.py b/epicyon.py index fcf0bd85d..b2b9799b0 100644 --- a/epicyon.py +++ b/epicyon.py @@ -961,7 +961,7 @@ def _command_options() -> None: domain, _ = get_domain_from_actor(url) url = http_prefix + '://' + domain + '/users/' + nickname timeout = 15 - sites_unavailable = [] + sites_unavailable: list[str] = [] active = site_is_active(url, timeout, sites_unavailable) if active: @@ -1857,7 +1857,7 @@ def _command_options() -> None: session_yggdrasil = None session = create_session(proxy_type) send_threads = [] - post_log = [] + post_log: list[str] = [] cached_webfingers = {} person_cache = {} if not domain: @@ -1918,7 +1918,7 @@ def _command_options() -> None: session_yggdrasil = None session = create_session(proxy_type) send_threads = [] - post_log = [] + post_log: list[str] = [] cached_webfingers = {} person_cache = {} if not domain: @@ -2052,7 +2052,7 @@ def _command_options() -> None: attached_image_description = remove_html(argb.imageDescription) city = 'London, England' send_threads = [] - post_log = [] + post_log: list[str] = [] person_cache = {} cached_webfingers = {} subject = argb.subject diff --git a/inbox.py b/inbox.py index 02baa0de5..98fc24bf0 100644 --- a/inbox.py +++ b/inbox.py @@ -3401,7 +3401,7 @@ def split_post_collection(collection_post_json: {}) -> []: return [collection_post_json] if not isinstance(collection_post_json['object']['orderedItems'], list): return [collection_post_json] - posts_list = [] + posts_list: list[dict] = [] for post_dict in collection_post_json['object']['orderedItems']: if not isinstance(post_dict, dict): continue diff --git a/maps.py b/maps.py index 2d88f50d5..a01fc2cb8 100644 --- a/maps.py +++ b/maps.py @@ -203,7 +203,7 @@ def html_address_book_list(base_dir: str, nickname: str, domain: str) -> str: if address_book_dict2: address_book_dict = address_book_dict2 - addresses_list = [] + addresses_list: list[str] = [] for _, address in address_book_dict.items(): addresses_list.append(address) addresses_list.sort() diff --git a/webapp_calendar.py b/webapp_calendar.py index 8993d42f2..25e96c55e 100644 --- a/webapp_calendar.py +++ b/webapp_calendar.py @@ -73,7 +73,7 @@ def html_calendar_delete_confirm(translate: {}, base_dir: str, instance_title = \ get_config_param(base_dir, 'instanceTitle') - preload_images = [] + preload_images: list[str] = [] delete_post_str = \ html_header_with_external_style(css_filename, instance_title, None, preload_images) diff --git a/webapp_hashtagswarm.py b/webapp_hashtagswarm.py index 1fe1e7fd6..21bc29616 100644 --- a/webapp_hashtagswarm.py +++ b/webapp_hashtagswarm.py @@ -417,7 +417,7 @@ def store_hash_tags(base_dir: str, nickname: str, domain: str, return if not has_object_dict(post_json_object): return - object_tags = [] + object_tags: list[dict] = [] if post_json_object['object'].get('tag'): object_tags = post_json_object['object']['tag'] if not post_json_object.get('id'):