mirror of https://gitlab.com/bashrc2/epicyon
List types
parent
c855c86e4e
commit
4c69380348
|
|
@ -714,7 +714,7 @@ def is_blocked_nickname(base_dir: str, nickname: str,
|
||||||
|
|
||||||
if not blocked_cache:
|
if not blocked_cache:
|
||||||
# instance-wide block list
|
# instance-wide block list
|
||||||
blocked_cache = []
|
blocked_cache: list[str] = []
|
||||||
global_blocking_filename = data_dir(base_dir) + '/blocking.txt'
|
global_blocking_filename = data_dir(base_dir) + '/blocking.txt'
|
||||||
if os.path.isfile(global_blocking_filename):
|
if os.path.isfile(global_blocking_filename):
|
||||||
blocked_cache_str = \
|
blocked_cache_str = \
|
||||||
|
|
|
||||||
6
blog.py
6
blog.py
|
|
@ -667,7 +667,7 @@ def html_blog_page(authorized: bool, session,
|
||||||
css_filename = base_dir + '/epicyon.css'
|
css_filename = base_dir + '/epicyon.css'
|
||||||
instance_title = \
|
instance_title = \
|
||||||
get_config_param(base_dir, 'instanceTitle')
|
get_config_param(base_dir, 'instanceTitle')
|
||||||
preload_images = []
|
preload_images: list[str] = []
|
||||||
blog_str = \
|
blog_str = \
|
||||||
html_header_with_external_style(css_filename, instance_title, None,
|
html_header_with_external_style(css_filename, instance_title, None,
|
||||||
preload_images)
|
preload_images)
|
||||||
|
|
@ -873,7 +873,7 @@ def html_blog_view(authorized: bool,
|
||||||
css_filename = base_dir + '/epicyon.css'
|
css_filename = base_dir + '/epicyon.css'
|
||||||
instance_title = \
|
instance_title = \
|
||||||
get_config_param(base_dir, 'instanceTitle')
|
get_config_param(base_dir, 'instanceTitle')
|
||||||
preload_images = []
|
preload_images: list[str] = []
|
||||||
blog_str = \
|
blog_str = \
|
||||||
html_header_with_external_style(css_filename, instance_title, None,
|
html_header_with_external_style(css_filename, instance_title, None,
|
||||||
preload_images)
|
preload_images)
|
||||||
|
|
@ -986,7 +986,7 @@ def html_edit_blog(media_instance: bool, translate: {},
|
||||||
|
|
||||||
instance_title = \
|
instance_title = \
|
||||||
get_config_param(base_dir, 'instanceTitle')
|
get_config_param(base_dir, 'instanceTitle')
|
||||||
preload_images = []
|
preload_images: list[str] = []
|
||||||
edit_blog_form = \
|
edit_blog_form = \
|
||||||
html_header_with_external_style(css_filename, instance_title, None,
|
html_header_with_external_style(css_filename, instance_title, None,
|
||||||
preload_images)
|
preload_images)
|
||||||
|
|
|
||||||
2
city.py
2
city.py
|
|
@ -237,7 +237,7 @@ def spoof_geolocation(base_dir: str,
|
||||||
if cities_str:
|
if cities_str:
|
||||||
cities = cities_str.split('\n')
|
cities = cities_str.split('\n')
|
||||||
|
|
||||||
nogo = []
|
nogo: list[list] = []
|
||||||
if nogo_list:
|
if nogo_list:
|
||||||
nogo = nogo_list
|
nogo = nogo_list
|
||||||
else:
|
else:
|
||||||
|
|
|
||||||
|
|
@ -1511,7 +1511,7 @@ def add_html_tags(base_dir: str, http_prefix: str,
|
||||||
long_words_list: list[str] = []
|
long_words_list: list[str] = []
|
||||||
prev_word_str: str = ''
|
prev_word_str: str = ''
|
||||||
auto_tags_list = _load_auto_tags(base_dir, nickname, domain)
|
auto_tags_list = _load_auto_tags(base_dir, nickname, domain)
|
||||||
append_tags = []
|
append_tags: list[str] = []
|
||||||
for word_str in words:
|
for word_str in words:
|
||||||
word_len = len(word_str)
|
word_len = len(word_str)
|
||||||
if word_len <= 2:
|
if word_len <= 2:
|
||||||
|
|
|
||||||
12
daemon.py
12
daemon.py
|
|
@ -431,7 +431,7 @@ class EpicyonServer(ThreadingHTTPServer):
|
||||||
received_message: bool = False
|
received_message: bool = False
|
||||||
inbox_queue: list[dict] = []
|
inbox_queue: list[dict] = []
|
||||||
send_threads = None
|
send_threads = None
|
||||||
post_log = []
|
post_log: list[str] = []
|
||||||
max_queue_length = 64
|
max_queue_length = 64
|
||||||
allow_deletion: bool = True
|
allow_deletion: bool = True
|
||||||
last_login_time = 0
|
last_login_time = 0
|
||||||
|
|
@ -443,7 +443,7 @@ class EpicyonServer(ThreadingHTTPServer):
|
||||||
tokens_lookup = {}
|
tokens_lookup = {}
|
||||||
instance_only_skills_search: bool = True
|
instance_only_skills_search: bool = True
|
||||||
followers_threads = []
|
followers_threads = []
|
||||||
blocked_cache = []
|
blocked_cache: list[str] = []
|
||||||
blocked_cache_last_updated = 0
|
blocked_cache_last_updated = 0
|
||||||
blocked_cache_update_secs = 120
|
blocked_cache_update_secs = 120
|
||||||
blocked_cache_last_updated = 0
|
blocked_cache_last_updated = 0
|
||||||
|
|
@ -468,7 +468,7 @@ class EpicyonServer(ThreadingHTTPServer):
|
||||||
fontsCache = {}
|
fontsCache = {}
|
||||||
shared_item_federation_tokens = None
|
shared_item_federation_tokens = None
|
||||||
shared_item_federation_tokens = None
|
shared_item_federation_tokens = None
|
||||||
peertube_instances = []
|
peertube_instances: list[str] = []
|
||||||
max_mentions = 10
|
max_mentions = 10
|
||||||
max_emoji = 10
|
max_emoji = 10
|
||||||
max_hashtags = 10
|
max_hashtags = 10
|
||||||
|
|
@ -491,16 +491,16 @@ class EpicyonServer(ThreadingHTTPServer):
|
||||||
instance_description_short: str = 'Epicyon'
|
instance_description_short: str = 'Epicyon'
|
||||||
robots_txt = None
|
robots_txt = None
|
||||||
last_llm_time = None
|
last_llm_time = None
|
||||||
mitm_servers = []
|
mitm_servers: list[str] = []
|
||||||
log_unknown_requests: bool = False
|
log_unknown_requests: bool = False
|
||||||
watermark_width_percent = 0
|
watermark_width_percent = 0
|
||||||
watermark_position = 0
|
watermark_position = 0
|
||||||
watermark_opacity = 0
|
watermark_opacity = 0
|
||||||
headers_catalog = {}
|
headers_catalog = {}
|
||||||
dictionary = []
|
dictionary: list[str] = []
|
||||||
twograms = {}
|
twograms = {}
|
||||||
searchable_by_default = {}
|
searchable_by_default = {}
|
||||||
known_epicyon_instances = []
|
known_epicyon_instances: list[str] = []
|
||||||
|
|
||||||
def handle_error(self, request, client_address):
|
def handle_error(self, request, client_address):
|
||||||
# surpress connection reset errors
|
# surpress connection reset errors
|
||||||
|
|
|
||||||
|
|
@ -961,7 +961,7 @@ def _command_options() -> None:
|
||||||
domain, _ = get_domain_from_actor(url)
|
domain, _ = get_domain_from_actor(url)
|
||||||
url = http_prefix + '://' + domain + '/users/' + nickname
|
url = http_prefix + '://' + domain + '/users/' + nickname
|
||||||
timeout = 15
|
timeout = 15
|
||||||
sites_unavailable = []
|
sites_unavailable: list[str] = []
|
||||||
active = site_is_active(url, timeout,
|
active = site_is_active(url, timeout,
|
||||||
sites_unavailable)
|
sites_unavailable)
|
||||||
if active:
|
if active:
|
||||||
|
|
@ -1857,7 +1857,7 @@ def _command_options() -> None:
|
||||||
session_yggdrasil = None
|
session_yggdrasil = None
|
||||||
session = create_session(proxy_type)
|
session = create_session(proxy_type)
|
||||||
send_threads = []
|
send_threads = []
|
||||||
post_log = []
|
post_log: list[str] = []
|
||||||
cached_webfingers = {}
|
cached_webfingers = {}
|
||||||
person_cache = {}
|
person_cache = {}
|
||||||
if not domain:
|
if not domain:
|
||||||
|
|
@ -1918,7 +1918,7 @@ def _command_options() -> None:
|
||||||
session_yggdrasil = None
|
session_yggdrasil = None
|
||||||
session = create_session(proxy_type)
|
session = create_session(proxy_type)
|
||||||
send_threads = []
|
send_threads = []
|
||||||
post_log = []
|
post_log: list[str] = []
|
||||||
cached_webfingers = {}
|
cached_webfingers = {}
|
||||||
person_cache = {}
|
person_cache = {}
|
||||||
if not domain:
|
if not domain:
|
||||||
|
|
@ -2052,7 +2052,7 @@ def _command_options() -> None:
|
||||||
attached_image_description = remove_html(argb.imageDescription)
|
attached_image_description = remove_html(argb.imageDescription)
|
||||||
city = 'London, England'
|
city = 'London, England'
|
||||||
send_threads = []
|
send_threads = []
|
||||||
post_log = []
|
post_log: list[str] = []
|
||||||
person_cache = {}
|
person_cache = {}
|
||||||
cached_webfingers = {}
|
cached_webfingers = {}
|
||||||
subject = argb.subject
|
subject = argb.subject
|
||||||
|
|
|
||||||
2
inbox.py
2
inbox.py
|
|
@ -3401,7 +3401,7 @@ def split_post_collection(collection_post_json: {}) -> []:
|
||||||
return [collection_post_json]
|
return [collection_post_json]
|
||||||
if not isinstance(collection_post_json['object']['orderedItems'], list):
|
if not isinstance(collection_post_json['object']['orderedItems'], list):
|
||||||
return [collection_post_json]
|
return [collection_post_json]
|
||||||
posts_list = []
|
posts_list: list[dict] = []
|
||||||
for post_dict in collection_post_json['object']['orderedItems']:
|
for post_dict in collection_post_json['object']['orderedItems']:
|
||||||
if not isinstance(post_dict, dict):
|
if not isinstance(post_dict, dict):
|
||||||
continue
|
continue
|
||||||
|
|
|
||||||
2
maps.py
2
maps.py
|
|
@ -203,7 +203,7 @@ def html_address_book_list(base_dir: str, nickname: str, domain: str) -> str:
|
||||||
if address_book_dict2:
|
if address_book_dict2:
|
||||||
address_book_dict = address_book_dict2
|
address_book_dict = address_book_dict2
|
||||||
|
|
||||||
addresses_list = []
|
addresses_list: list[str] = []
|
||||||
for _, address in address_book_dict.items():
|
for _, address in address_book_dict.items():
|
||||||
addresses_list.append(address)
|
addresses_list.append(address)
|
||||||
addresses_list.sort()
|
addresses_list.sort()
|
||||||
|
|
|
||||||
|
|
@ -73,7 +73,7 @@ def html_calendar_delete_confirm(translate: {}, base_dir: str,
|
||||||
|
|
||||||
instance_title = \
|
instance_title = \
|
||||||
get_config_param(base_dir, 'instanceTitle')
|
get_config_param(base_dir, 'instanceTitle')
|
||||||
preload_images = []
|
preload_images: list[str] = []
|
||||||
delete_post_str = \
|
delete_post_str = \
|
||||||
html_header_with_external_style(css_filename, instance_title, None,
|
html_header_with_external_style(css_filename, instance_title, None,
|
||||||
preload_images)
|
preload_images)
|
||||||
|
|
|
||||||
|
|
@ -417,7 +417,7 @@ def store_hash_tags(base_dir: str, nickname: str, domain: str,
|
||||||
return
|
return
|
||||||
if not has_object_dict(post_json_object):
|
if not has_object_dict(post_json_object):
|
||||||
return
|
return
|
||||||
object_tags = []
|
object_tags: list[dict] = []
|
||||||
if post_json_object['object'].get('tag'):
|
if post_json_object['object'].get('tag'):
|
||||||
object_tags = post_json_object['object']['tag']
|
object_tags = post_json_object['object']['tag']
|
||||||
if not post_json_object.get('id'):
|
if not post_json_object.get('id'):
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue