List types

main
bashrc 2026-04-27 16:28:20 +01:00
parent c855c86e4e
commit 4c69380348
10 changed files with 20 additions and 20 deletions

View File

@ -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 = \

View File

@ -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)

View File

@ -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:

View File

@ -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:

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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()

View File

@ -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)

View File

@ -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'):