Remove old css cache

main
Bob Mottram 2022-07-12 20:03:30 +01:00
parent 6345374a0b
commit 6d42faf737
19 changed files with 109 additions and 180 deletions

168
daemon.py
View File

@ -2118,8 +2118,7 @@ class PubServer(BaseHTTPRequestHandler):
del self.server.login_failure_count[ip_address]
if is_suspended(base_dir, login_nickname):
msg = \
html_suspended(self.server.css_cache,
base_dir).encode('utf-8')
html_suspended(base_dir).encode('utf-8')
msglen = len(msg)
self._login_headers('text/html',
msglen, calling_domain)
@ -2299,8 +2298,7 @@ class PubServer(BaseHTTPRequestHandler):
search_handle = ''
if '@' in search_handle:
msg = \
html_account_info(self.server.css_cache,
self.server.translate,
html_account_info(self.server.translate,
base_dir, http_prefix,
nickname,
self.server.domain,
@ -3073,8 +3071,7 @@ class PubServer(BaseHTTPRequestHandler):
if debug:
print('Unblocking ' + options_actor)
msg = \
html_confirm_unblock(self.server.css_cache,
self.server.translate,
html_confirm_unblock(self.server.translate,
base_dir,
users_path,
options_actor,
@ -3093,8 +3090,7 @@ class PubServer(BaseHTTPRequestHandler):
if debug:
print('Following ' + options_actor)
msg = \
html_confirm_follow(self.server.css_cache,
self.server.translate,
html_confirm_follow(self.server.translate,
base_dir,
users_path,
options_actor,
@ -3112,8 +3108,7 @@ class PubServer(BaseHTTPRequestHandler):
'&submitLeave=' in options_confirm_params:
print('Unfollowing ' + options_actor)
msg = \
html_confirm_unfollow(self.server.css_cache,
self.server.translate,
html_confirm_unfollow(self.server.translate,
base_dir,
users_path,
options_actor,
@ -3148,8 +3143,7 @@ class PubServer(BaseHTTPRequestHandler):
if self.server.bold_reading.get(chooser_nickname):
bold_reading = True
msg = html_new_post(self.server.css_cache,
False, self.server.translate,
msg = html_new_post(False, self.server.translate,
base_dir,
http_prefix,
report_path, None,
@ -3201,8 +3195,7 @@ class PubServer(BaseHTTPRequestHandler):
print('Showing info for ' + options_actor)
signing_priv_key_pem = self.server.signing_priv_key_pem
msg = \
html_account_info(self.server.css_cache,
self.server.translate,
html_account_info(self.server.translate,
base_dir,
http_prefix,
chooser_nickname,
@ -3294,8 +3287,7 @@ class PubServer(BaseHTTPRequestHandler):
if self.server.bold_reading.get(chooser_nickname):
bold_reading = True
msg = html_new_post(self.server.css_cache,
False, self.server.translate,
msg = html_new_post(False, self.server.translate,
base_dir,
http_prefix,
report_path, None, [],
@ -10434,7 +10426,6 @@ class PubServer(BaseHTTPRequestHandler):
delete_str = \
html_confirm_delete(self.server,
self.server.css_cache,
self.server.recent_posts_cache,
self.server.max_recent_posts,
self.server.translate, page_number,
@ -11040,7 +11031,6 @@ class PubServer(BaseHTTPRequestHandler):
msg = \
html_profile(self.server.signing_priv_key_pem,
self.server.rss_icon_at_top,
self.server.css_cache,
icons_as_buttons,
default_timeline,
recent_posts_cache,
@ -11172,7 +11162,6 @@ class PubServer(BaseHTTPRequestHandler):
msg = \
html_profile(signing_priv_key_pem,
self.server.rss_icon_at_top,
self.server.css_cache,
icons_as_buttons,
default_timeline,
recent_posts_cache,
@ -11833,8 +11822,7 @@ class PubServer(BaseHTTPRequestHandler):
bold_reading = False
if self.server.bold_reading.get(nickname):
bold_reading = True
msg = html_inbox(self.server.css_cache,
default_timeline,
msg = html_inbox(default_timeline,
recent_posts_cache,
max_recent_posts,
translate,
@ -12006,8 +11994,7 @@ class PubServer(BaseHTTPRequestHandler):
if self.server.bold_reading.get(nickname):
bold_reading = True
msg = \
html_inbox_dms(self.server.css_cache,
self.server.default_timeline,
html_inbox_dms(self.server.default_timeline,
self.server.recent_posts_cache,
self.server.max_recent_posts,
self.server.translate,
@ -12167,8 +12154,7 @@ class PubServer(BaseHTTPRequestHandler):
if self.server.bold_reading.get(nickname):
bold_reading = True
msg = \
html_inbox_replies(self.server.css_cache,
self.server.default_timeline,
html_inbox_replies(self.server.default_timeline,
self.server.recent_posts_cache,
self.server.max_recent_posts,
self.server.translate,
@ -12325,8 +12311,7 @@ class PubServer(BaseHTTPRequestHandler):
if self.server.bold_reading.get(nickname):
bold_reading = True
msg = \
html_inbox_media(self.server.css_cache,
self.server.default_timeline,
html_inbox_media(self.server.default_timeline,
self.server.recent_posts_cache,
self.server.max_recent_posts,
self.server.translate,
@ -12484,8 +12469,7 @@ class PubServer(BaseHTTPRequestHandler):
if self.server.bold_reading.get(nickname):
bold_reading = True
msg = \
html_inbox_blogs(self.server.css_cache,
self.server.default_timeline,
html_inbox_blogs(self.server.default_timeline,
self.server.recent_posts_cache,
self.server.max_recent_posts,
self.server.translate,
@ -12651,8 +12635,7 @@ class PubServer(BaseHTTPRequestHandler):
if self.server.bold_reading.get(nickname):
bold_reading = True
msg = \
html_inbox_news(self.server.css_cache,
self.server.default_timeline,
html_inbox_news(self.server.default_timeline,
self.server.recent_posts_cache,
self.server.max_recent_posts,
self.server.translate,
@ -12822,8 +12805,7 @@ class PubServer(BaseHTTPRequestHandler):
if self.server.bold_reading.get(nickname):
bold_reading = True
msg = \
html_inbox_features(self.server.css_cache,
self.server.default_timeline,
html_inbox_features(self.server.default_timeline,
self.server.recent_posts_cache,
self.server.max_recent_posts,
self.server.translate,
@ -12947,8 +12929,7 @@ class PubServer(BaseHTTPRequestHandler):
if self.server.bold_reading.get(nickname):
bold_reading = True
msg = \
html_shares(self.server.css_cache,
self.server.default_timeline,
html_shares(self.server.default_timeline,
self.server.recent_posts_cache,
self.server.max_recent_posts,
self.server.translate,
@ -13041,8 +13022,7 @@ class PubServer(BaseHTTPRequestHandler):
if self.server.bold_reading.get(nickname):
bold_reading = True
msg = \
html_wanted(self.server.css_cache,
self.server.default_timeline,
html_wanted(self.server.default_timeline,
self.server.recent_posts_cache,
self.server.max_recent_posts,
self.server.translate,
@ -13176,8 +13156,7 @@ class PubServer(BaseHTTPRequestHandler):
if self.server.bold_reading.get(nickname):
bold_reading = True
msg = \
html_bookmarks(self.server.css_cache,
self.server.default_timeline,
html_bookmarks(self.server.default_timeline,
self.server.recent_posts_cache,
self.server.max_recent_posts,
self.server.translate,
@ -13330,8 +13309,7 @@ class PubServer(BaseHTTPRequestHandler):
if self.server.bold_reading.get(nickname):
bold_reading = True
msg = \
html_outbox(self.server.css_cache,
self.server.default_timeline,
html_outbox(self.server.default_timeline,
self.server.recent_posts_cache,
self.server.max_recent_posts,
self.server.translate,
@ -13478,8 +13456,7 @@ class PubServer(BaseHTTPRequestHandler):
if self.server.bold_reading.get(nickname):
bold_reading = True
msg = \
html_moderation(self.server.css_cache,
self.server.default_timeline,
html_moderation(self.server.default_timeline,
self.server.recent_posts_cache,
self.server.max_recent_posts,
self.server.translate,
@ -13627,7 +13604,6 @@ class PubServer(BaseHTTPRequestHandler):
msg = \
html_profile(self.server.signing_priv_key_pem,
self.server.rss_icon_at_top,
self.server.css_cache,
self.server.icons_as_buttons,
self.server.default_timeline,
self.server.recent_posts_cache,
@ -13766,7 +13742,6 @@ class PubServer(BaseHTTPRequestHandler):
msg = \
html_profile(self.server.signing_priv_key_pem,
self.server.rss_icon_at_top,
self.server.css_cache,
self.server.icons_as_buttons,
self.server.default_timeline,
self.server.recent_posts_cache,
@ -13904,7 +13879,6 @@ class PubServer(BaseHTTPRequestHandler):
msg = \
html_profile(self.server.signing_priv_key_pem,
self.server.rss_icon_at_top,
self.server.css_cache,
self.server.icons_as_buttons,
self.server.default_timeline,
self.server.recent_posts_cache,
@ -14068,7 +14042,6 @@ class PubServer(BaseHTTPRequestHandler):
msg = \
html_profile(self.server.signing_priv_key_pem,
self.server.rss_icon_at_top,
self.server.css_cache,
self.server.icons_as_buttons,
self.server.default_timeline,
self.server.recent_posts_cache,
@ -14352,8 +14325,7 @@ class PubServer(BaseHTTPRequestHandler):
tries = 0
while tries < 5:
try:
css = get_css(self.server.base_dir, path,
self.server.css_cache)
css = get_css(self.server.base_dir, path)
if css:
break
except BaseException as ex:
@ -14857,8 +14829,7 @@ class PubServer(BaseHTTPRequestHandler):
if self.server.bold_reading.get(nickname):
bold_reading = True
msg = html_new_post(self.server.css_cache,
media_instance,
msg = html_new_post(media_instance,
translate,
base_dir,
http_prefix,
@ -14997,8 +14968,7 @@ class PubServer(BaseHTTPRequestHandler):
if self.server.key_shortcuts.get(nickname):
access_keys = self.server.key_shortcuts[nickname]
msg = html_edit_links(self.server.css_cache,
translate,
msg = html_edit_links(translate,
base_dir,
path, domain,
port,
@ -15031,8 +15001,7 @@ class PubServer(BaseHTTPRequestHandler):
if self.server.key_shortcuts.get(nickname):
access_keys = self.server.key_shortcuts[nickname]
msg = html_edit_newswire(self.server.css_cache,
translate,
msg = html_edit_newswire(translate,
base_dir,
path, domain,
port,
@ -15052,11 +15021,11 @@ class PubServer(BaseHTTPRequestHandler):
return True
return False
def _edit_news_post(self, calling_domain: str, path: str,
translate: {}, base_dir: str,
http_prefix: str, domain: str, port: int,
domain_full: str,
cookie: str) -> bool:
def _edit_news_post2(self, calling_domain: str, path: str,
translate: {}, base_dir: str,
http_prefix: str, domain: str, port: int,
domain_full: str,
cookie: str) -> bool:
"""Show the edit screen for a news post
"""
if '/users/' in path and '/editnewspost=' in path:
@ -15072,8 +15041,7 @@ class PubServer(BaseHTTPRequestHandler):
local_actor_url(http_prefix, post_actor, domain_full) + \
'/statuses/' + post_id
path = path.split('/editnewspost=')[0]
msg = html_edit_news_post(self.server.css_cache,
translate, base_dir,
msg = html_edit_news_post(translate, base_dir,
path, domain, port,
http_prefix,
post_url,
@ -15264,8 +15232,7 @@ class PubServer(BaseHTTPRequestHandler):
if self.path == '/logout':
if not self.server.news_instance:
msg = \
html_login(self.server.css_cache,
self.server.translate,
html_login(self.server.translate,
self.server.base_dir,
self.server.http_prefix,
self.server.domain_full,
@ -15898,8 +15865,7 @@ class PubServer(BaseHTTPRequestHandler):
if self.server.newswire.get(episode_timestamp):
pod_episode = self.server.newswire[episode_timestamp]
html_str = \
html_podcast_episode(self.server.css_cache,
self.server.translate,
html_podcast_episode(self.server.translate,
self.server.base_dir,
nickname,
self.server.domain,
@ -16294,8 +16260,7 @@ class PubServer(BaseHTTPRequestHandler):
actor = \
self.server.http_prefix + '://' + \
self.server.domain_full + users_path
msg = html_confirm_remove_shared_item(self.server.css_cache,
self.server.translate,
msg = html_confirm_remove_shared_item(self.server.translate,
self.server.base_dir,
actor, item_id,
calling_domain, 'shares')
@ -16327,8 +16292,7 @@ class PubServer(BaseHTTPRequestHandler):
actor = \
self.server.http_prefix + '://' + \
self.server.domain_full + users_path
msg = html_confirm_remove_shared_item(self.server.css_cache,
self.server.translate,
msg = html_confirm_remove_shared_item(self.server.translate,
self.server.base_dir,
actor, item_id,
calling_domain, 'wanted')
@ -16411,22 +16375,19 @@ class PubServer(BaseHTTPRequestHandler):
if self.path.endswith('/about'):
if calling_domain.endswith('.onion'):
msg = \
html_about(self.server.css_cache,
self.server.base_dir, 'http',
html_about(self.server.base_dir, 'http',
self.server.onion_domain,
None, self.server.translate,
self.server.system_language)
elif calling_domain.endswith('.i2p'):
msg = \
html_about(self.server.css_cache,
self.server.base_dir, 'http',
html_about(self.server.base_dir, 'http',
self.server.i2p_domain,
None, self.server.translate,
self.server.system_language)
else:
msg = \
html_about(self.server.css_cache,
self.server.base_dir,
html_about(self.server.base_dir,
self.server.http_prefix,
self.server.domain_full,
self.server.onion_domain,
@ -16444,22 +16405,19 @@ class PubServer(BaseHTTPRequestHandler):
if self.path in ('/specification', '/protocol', '/activitypub'):
if calling_domain.endswith('.onion'):
msg = \
html_specification(self.server.css_cache,
self.server.base_dir, 'http',
html_specification(self.server.base_dir, 'http',
self.server.onion_domain,
None, self.server.translate,
self.server.system_language)
elif calling_domain.endswith('.i2p'):
msg = \
html_specification(self.server.css_cache,
self.server.base_dir, 'http',
html_specification(self.server.base_dir, 'http',
self.server.i2p_domain,
None, self.server.translate,
self.server.system_language)
else:
msg = \
html_specification(self.server.css_cache,
self.server.base_dir,
html_specification(self.server.base_dir,
self.server.http_prefix,
self.server.domain_full,
self.server.onion_domain,
@ -16486,8 +16444,7 @@ class PubServer(BaseHTTPRequestHandler):
self.server.key_shortcuts[nickname]
msg = \
html_access_keys(self.server.css_cache,
self.server.base_dir,
html_access_keys(self.server.base_dir,
nickname, self.server.domain,
self.server.translate,
access_keys,
@ -16514,8 +16471,7 @@ class PubServer(BaseHTTPRequestHandler):
return
msg = \
html_theme_designer(self.server.css_cache,
self.server.base_dir,
html_theme_designer(self.server.base_dir,
nickname, self.server.domain,
self.server.translate,
self.server.default_timeline,
@ -16972,8 +16928,7 @@ class PubServer(BaseHTTPRequestHandler):
not authorized and
not self.server.news_instance)):
# request basic auth
msg = html_login(self.server.css_cache,
self.server.translate,
msg = html_login(self.server.translate,
self.server.base_dir,
self.server.http_prefix,
self.server.domain_full,
@ -17042,8 +16997,7 @@ class PubServer(BaseHTTPRequestHandler):
if self.server.key_shortcuts.get(nickname):
access_keys = self.server.key_shortcuts[nickname]
msg = \
html_newswire_mobile(self.server.css_cache,
self.server.base_dir,
html_newswire_mobile(self.server.base_dir,
nickname,
self.server.domain,
self.server.domain_full,
@ -17087,8 +17041,7 @@ class PubServer(BaseHTTPRequestHandler):
shared_items_domains = \
self.server.shared_items_federated_domains
msg = \
html_links_mobile(self.server.css_cache,
self.server.base_dir, nickname,
html_links_mobile(self.server.base_dir, nickname,
self.server.domain_full,
self.server.http_prefix,
self.server.translate,
@ -17204,8 +17157,7 @@ class PubServer(BaseHTTPRequestHandler):
# show a hashtag category from the search screen
if html_getreq and '/category/' in self.path:
msg = html_search_hashtag_category(self.server.css_cache,
self.server.translate,
msg = html_search_hashtag_category(self.server.translate,
self.server.base_dir, self.path,
self.server.domain,
self.server.theme_name)
@ -17238,7 +17190,6 @@ class PubServer(BaseHTTPRequestHandler):
# show the calendar screen
msg = html_calendar(self.server.person_cache,
self.server.css_cache,
self.server.translate,
self.server.base_dir, self.path,
self.server.http_prefix,
@ -17281,7 +17232,6 @@ class PubServer(BaseHTTPRequestHandler):
# show the calendar screen
msg = html_calendar(self.server.person_cache,
self.server.css_cache,
self.server.translate,
self.server.base_dir, self.path,
self.server.http_prefix,
@ -17909,14 +17859,14 @@ class PubServer(BaseHTTPRequestHandler):
return
# edit news post
if self._edit_news_post(calling_domain, self.path,
self.server.translate,
self.server.base_dir,
self.server.http_prefix,
self.server.domain,
self.server.port,
self.server.domain_full,
cookie):
if self._edit_news_post2(calling_domain, self.path,
self.server.translate,
self.server.base_dir,
self.server.http_prefix,
self.server.domain,
self.server.port,
self.server.domain_full,
cookie):
self.server.getreq_busy = False
return
@ -18336,8 +18286,7 @@ class PubServer(BaseHTTPRequestHandler):
block_domain = block_domain.split('?')[0]
add_global_block(self.server.base_dir, '*', block_domain)
msg = \
html_account_info(self.server.css_cache,
self.server.translate,
html_account_info(self.server.translate,
self.server.base_dir,
self.server.http_prefix,
nickname,
@ -18374,8 +18323,7 @@ class PubServer(BaseHTTPRequestHandler):
block_domain = urllib.parse.unquote_plus(block_domain.strip())
remove_global_block(self.server.base_dir, '*', block_domain)
msg = \
html_account_info(self.server.css_cache,
self.server.translate,
html_account_info(self.server.translate,
self.server.base_dir,
self.server.http_prefix,
nickname,
@ -19117,7 +19065,6 @@ class PubServer(BaseHTTPRequestHandler):
self.server.default_timeline,
self.server.translate,
self.server.newswire,
self.server.css_cache,
fields['subject'],
fields['message'],
filename, attachment_media_type,
@ -21378,9 +21325,6 @@ def run_daemon(preferred_podcast_formats: [],
httpd.blocked_cache_last_updated,
httpd.blocked_cache_update_secs)
# cache to store css files
httpd.css_cache = {}
# get the list of custom emoji, for use by the mastodon api
httpd.custom_emoji = \
metadata_custom_emoji(base_dir, http_prefix, httpd.domain_full)

View File

@ -2409,30 +2409,15 @@ def file_last_modified(filename: str) -> str:
return modified_time.strftime("%Y-%m-%dT%H:%M:%SZ")
def get_css(base_dir: str, css_filename: str, css_cache: {}) -> str:
def get_css(base_dir: str, css_filename: str) -> str:
"""Retrieves the css for a given file, or from a cache
"""
# does the css file exist?
if not os.path.isfile(css_filename):
return None
last_modified = file_last_modified(css_filename)
# has this already been loaded into the cache?
if css_cache.get(css_filename):
if css_cache[css_filename][0] == last_modified:
# file hasn't changed, so return the version in the cache
return css_cache[css_filename][1]
with open(css_filename, 'r', encoding='utf-8') as fp_css:
css = fp_css.read()
if css_cache.get(css_filename):
# alter the cache contents
css_cache[css_filename][0] = last_modified
css_cache[css_filename][1] = css
else:
# add entry to the cache
css_cache[css_filename] = [last_modified, css]
return css
return None

View File

@ -15,7 +15,7 @@ from webapp_utils import html_footer
from markdown import markdown_to_html
def html_about(css_cache: {}, base_dir: str, http_prefix: str,
def html_about(base_dir: str, http_prefix: str,
domain_full: str, onion_domain: str, translate: {},
system_language: str) -> str:
"""Show the about screen

View File

@ -40,7 +40,7 @@ def load_access_keys_for_accounts(base_dir: str, key_shortcuts: {},
break
def html_access_keys(css_cache: {}, base_dir: str,
def html_access_keys(base_dir: str,
nickname: str, domain: str,
translate: {}, access_keys: {},
default_access_keys: {},

View File

@ -103,7 +103,7 @@ def html_calendar_delete_confirm(translate: {}, base_dir: str,
return delete_post_str
def _html_calendar_day(person_cache: {}, css_cache: {}, translate: {},
def _html_calendar_day(person_cache: {}, translate: {},
base_dir: str, path: str,
year: int, month_number: int, day_number: int,
nickname: str, domain: str, day_events: [],
@ -317,7 +317,7 @@ def _html_calendar_day(person_cache: {}, css_cache: {}, translate: {},
return calendar_str
def html_calendar(person_cache: {}, css_cache: {}, translate: {},
def html_calendar(person_cache: {}, translate: {},
base_dir: str, path: str,
http_prefix: str, domain_full: str,
text_mode_banner: str, access_keys: {},
@ -393,7 +393,7 @@ def html_calendar(person_cache: {}, css_cache: {}, translate: {},
if events:
if events.get(str(day_number)):
day_events = events[str(day_number)]
return _html_calendar_day(person_cache, css_cache,
return _html_calendar_day(person_cache,
translate, base_dir, path,
year, month_number, day_number,
nickname, domain, day_events,

View File

@ -359,7 +359,7 @@ def get_left_column_content(base_dir: str, nickname: str, domain_full: str,
return html_str
def html_links_mobile(css_cache: {}, base_dir: str,
def html_links_mobile(base_dir: str,
nickname: str, domain_full: str,
http_prefix: str, translate,
timeline_path: str, authorized: bool,
@ -425,7 +425,7 @@ def html_links_mobile(css_cache: {}, base_dir: str,
return html_str
def html_edit_links(css_cache: {}, translate: {}, base_dir: str, path: str,
def html_edit_links(translate: {}, base_dir: str, path: str,
domain: str, port: int, http_prefix: str,
default_timeline: str, theme: str,
access_keys: {}) -> str:

View File

@ -355,7 +355,7 @@ def _html_newswire(base_dir: str, newswire: {}, nickname: str, moderator: bool,
def html_citations(base_dir: str, nickname: str, domain: str,
http_prefix: str, default_timeline: str,
translate: {}, newswire: {}, css_cache: {},
translate: {}, newswire: {},
blog_title: str, blog_content: str,
blog_image_filename: str,
blog_image_attachment_media_type: str,
@ -470,7 +470,7 @@ def html_citations(base_dir: str, nickname: str, domain: str,
return html_str + html_footer()
def html_newswire_mobile(css_cache: {}, base_dir: str, nickname: str,
def html_newswire_mobile(base_dir: str, nickname: str,
domain: str, domain_full: str,
http_prefix: str, translate: {},
newswire: {},
@ -546,7 +546,7 @@ def html_newswire_mobile(css_cache: {}, base_dir: str, nickname: str,
return html_str
def html_edit_newswire(css_cache: {}, translate: {}, base_dir: str, path: str,
def html_edit_newswire(translate: {}, base_dir: str, path: str,
domain: str, port: int, http_prefix: str,
default_timeline: str, theme: str,
access_keys: {}, dogwhistles: {}) -> str:
@ -688,7 +688,7 @@ def html_edit_newswire(css_cache: {}, translate: {}, base_dir: str, path: str,
return edit_newswire_form
def html_edit_news_post(css_cache: {}, translate: {}, base_dir: str, path: str,
def html_edit_news_post(translate: {}, base_dir: str, path: str,
domain: str, port: int, http_prefix: str, postUrl: str,
system_language: str) -> str:
"""Edits a news post on the news/features timeline

View File

@ -24,7 +24,7 @@ from webapp_utils import html_footer
from webapp_post import individual_post_as_html
def html_confirm_delete(server, css_cache: {},
def html_confirm_delete(server,
recent_posts_cache: {}, max_recent_posts: int,
translate, page_number: int,
session, base_dir: str, message_id: str,
@ -118,7 +118,7 @@ def html_confirm_delete(server, css_cache: {},
return delete_post_str
def html_confirm_remove_shared_item(css_cache: {}, translate: {},
def html_confirm_remove_shared_item(translate: {},
base_dir: str,
actor: str, item_id: str,
calling_domain: str,
@ -190,7 +190,7 @@ def html_confirm_remove_shared_item(css_cache: {}, translate: {},
return shares_str
def html_confirm_follow(css_cache: {}, translate: {}, base_dir: str,
def html_confirm_follow(translate: {}, base_dir: str,
origin_path_str: str,
follow_actor: str,
follow_profile_url: str) -> str:
@ -240,7 +240,7 @@ def html_confirm_follow(css_cache: {}, translate: {}, base_dir: str,
return follow_str
def html_confirm_unfollow(css_cache: {}, translate: {}, base_dir: str,
def html_confirm_unfollow(translate: {}, base_dir: str,
origin_path_str: str,
follow_actor: str,
follow_profile_url: str) -> str:
@ -290,7 +290,7 @@ def html_confirm_unfollow(css_cache: {}, translate: {}, base_dir: str,
return follow_str
def html_confirm_unblock(css_cache: {}, translate: {}, base_dir: str,
def html_confirm_unblock(translate: {}, base_dir: str,
origin_path_str: str,
block_actor: str,
block_profile_url: str) -> str:

View File

@ -197,7 +197,7 @@ def _html_new_post_drop_down(scope_icon: str, scope_description: str,
return drop_down_content
def html_new_post(css_cache: {}, media_instance: bool, translate: {},
def html_new_post(media_instance: bool, translate: {},
base_dir: str, http_prefix: str,
path: str, in_reply_to: str,
mentions: [],

View File

@ -102,7 +102,7 @@ def _html_front_screen_posts(recent_posts_cache: {}, max_recent_posts: int,
def html_front_screen(signing_priv_key_pem: str,
rss_icon_at_top: bool,
css_cache: {}, icons_as_buttons: bool,
icons_as_buttons: bool,
default_timeline: str,
recent_posts_cache: {}, max_recent_posts: int,
translate: {}, project_version: str,

View File

@ -193,7 +193,7 @@ def html_hash_tag_swarm(base_dir: str, actor: str, translate: {}) -> str:
return tag_swarm_html
def html_search_hashtag_category(css_cache: {}, translate: {},
def html_search_hashtag_category(translate: {},
base_dir: str, path: str, domain: str,
theme: str) -> str:
"""Show hashtags after selecting a category on the main search screen

View File

@ -54,7 +54,7 @@ def html_get_login_credentials(loginParams: str,
return nickname, password, register
def html_login(css_cache: {}, translate: {},
def html_login(translate: {},
base_dir: str,
http_prefix: str, domain: str,
system_language: str,

View File

@ -32,7 +32,7 @@ from blocking import is_blocked
from session import create_session
def html_moderation(css_cache: {}, default_timeline: str,
def html_moderation(default_timeline: str,
recent_posts_cache: {}, max_recent_posts: int,
translate: {}, page_number: int, items_per_page: int,
session, base_dir: str, wf_request: {}, person_cache: {},
@ -63,7 +63,7 @@ def html_moderation(css_cache: {}, default_timeline: str,
This is what you see when selecting the "mod" timeline
"""
artist = is_artist(base_dir, nickname)
return html_timeline(css_cache, default_timeline,
return html_timeline(default_timeline,
recent_posts_cache, max_recent_posts,
translate, page_number,
items_per_page, session, base_dir,
@ -87,7 +87,7 @@ def html_moderation(css_cache: {}, default_timeline: str,
timezone, bold_reading, dogwhistles)
def html_account_info(css_cache: {}, translate: {},
def html_account_info(translate: {},
base_dir: str, http_prefix: str,
nickname: str, domain: str, port: int,
search_handle: str, debug: bool,

View File

@ -292,7 +292,7 @@ def _html_podcast_soundbites(link_url: str, extension: str,
return podcast_str
def html_podcast_episode(css_cache: {}, translate: {},
def html_podcast_episode(translate: {},
base_dir: str, nickname: str, domain: str,
newswire_item: [], theme: str,
default_timeline: str,

View File

@ -593,7 +593,7 @@ def _get_profile_header_after_search(nickname: str, default_timeline: str,
def html_profile(signing_priv_key_pem: str,
rss_icon_at_top: bool,
css_cache: {}, icons_as_buttons: bool,
icons_as_buttons: bool,
default_timeline: str,
recent_posts_cache: {}, max_recent_posts: int,
translate: {}, project_version: str,
@ -623,7 +623,7 @@ def html_profile(signing_priv_key_pem: str,
if is_system_account(nickname):
return html_front_screen(signing_priv_key_pem,
rss_icon_at_top,
css_cache, icons_as_buttons,
icons_as_buttons,
default_timeline,
recent_posts_cache, max_recent_posts,
translate, project_version,

View File

@ -16,7 +16,7 @@ from markdown import markdown_example_numbers
from markdown import markdown_to_html
def html_specification(css_cache: {}, base_dir: str, http_prefix: str,
def html_specification(base_dir: str, http_prefix: str,
domain_full: str, onion_domain: str, translate: {},
system_language: str) -> str:
"""Show the specification screen

View File

@ -13,7 +13,7 @@ from webapp_utils import html_header_with_external_style
from webapp_utils import html_footer
def html_suspended(css_cache: {}, base_dir: str) -> str:
def html_suspended(base_dir: str) -> str:
"""Show the screen for suspended accounts
"""
suspended_form = ''

View File

@ -166,7 +166,7 @@ color_to_hex = {
}
def html_theme_designer(css_cache: {}, base_dir: str,
def html_theme_designer(base_dir: str,
nickname: str, domain: str,
translate: {}, default_timeline: str,
theme_name: str, access_keys: {}) -> str:

View File

@ -461,7 +461,7 @@ def page_number_buttons(users_path: str, box_name: str,
'</center>\n'
def html_timeline(css_cache: {}, default_timeline: str,
def html_timeline(default_timeline: str,
recent_posts_cache: {}, max_recent_posts: int,
translate: {}, page_number: int,
items_per_page: int, session, base_dir: str,
@ -1217,7 +1217,7 @@ def _html_shares_timeline(translate: {}, page_number: int, items_per_page: int,
return timeline_str
def html_shares(css_cache: {}, default_timeline: str,
def html_shares(default_timeline: str,
recent_posts_cache: {}, max_recent_posts: int,
translate: {}, page_number: int, items_per_page: int,
session, base_dir: str,
@ -1251,7 +1251,7 @@ def html_shares(css_cache: {}, default_timeline: str,
follower_approval_active(base_dir, nickname, domain)
artist = is_artist(base_dir, nickname)
return html_timeline(css_cache, default_timeline,
return html_timeline(default_timeline,
recent_posts_cache, max_recent_posts,
translate, page_number,
items_per_page, session, base_dir,
@ -1278,7 +1278,7 @@ def html_shares(css_cache: {}, default_timeline: str,
bold_reading, dogwhistles)
def html_wanted(css_cache: {}, default_timeline: str,
def html_wanted(default_timeline: str,
recent_posts_cache: {}, max_recent_posts: int,
translate: {}, page_number: int, items_per_page: int,
session, base_dir: str,
@ -1312,7 +1312,7 @@ def html_wanted(css_cache: {}, default_timeline: str,
follower_approval_active(base_dir, nickname, domain)
artist = is_artist(base_dir, nickname)
return html_timeline(css_cache, default_timeline,
return html_timeline(default_timeline,
recent_posts_cache, max_recent_posts,
translate, page_number,
items_per_page, session, base_dir,
@ -1339,7 +1339,7 @@ def html_wanted(css_cache: {}, default_timeline: str,
bold_reading, dogwhistles)
def html_inbox(css_cache: {}, default_timeline: str,
def html_inbox(default_timeline: str,
recent_posts_cache: {}, max_recent_posts: int,
translate: {}, page_number: int, items_per_page: int,
session, base_dir: str,
@ -1374,7 +1374,7 @@ def html_inbox(css_cache: {}, default_timeline: str,
follower_approval_active(base_dir, nickname, domain)
artist = is_artist(base_dir, nickname)
return html_timeline(css_cache, default_timeline,
return html_timeline(default_timeline,
recent_posts_cache, max_recent_posts,
translate, page_number,
items_per_page, session, base_dir,
@ -1401,7 +1401,7 @@ def html_inbox(css_cache: {}, default_timeline: str,
bold_reading, dogwhistles)
def html_bookmarks(css_cache: {}, default_timeline: str,
def html_bookmarks(default_timeline: str,
recent_posts_cache: {}, max_recent_posts: int,
translate: {}, page_number: int, items_per_page: int,
session, base_dir: str,
@ -1436,7 +1436,7 @@ def html_bookmarks(css_cache: {}, default_timeline: str,
follower_approval_active(base_dir, nickname, domain)
artist = is_artist(base_dir, nickname)
return html_timeline(css_cache, default_timeline,
return html_timeline(default_timeline,
recent_posts_cache, max_recent_posts,
translate, page_number,
items_per_page, session, base_dir,
@ -1462,7 +1462,7 @@ def html_bookmarks(css_cache: {}, default_timeline: str,
bold_reading, dogwhistles)
def html_inbox_dms(css_cache: {}, default_timeline: str,
def html_inbox_dms(default_timeline: str,
recent_posts_cache: {}, max_recent_posts: int,
translate: {}, page_number: int, items_per_page: int,
session, base_dir: str,
@ -1494,7 +1494,7 @@ def html_inbox_dms(css_cache: {}, default_timeline: str,
"""Show the DM timeline as html
"""
artist = is_artist(base_dir, nickname)
return html_timeline(css_cache, default_timeline,
return html_timeline(default_timeline,
recent_posts_cache, max_recent_posts,
translate, page_number,
items_per_page, session, base_dir,
@ -1519,7 +1519,7 @@ def html_inbox_dms(css_cache: {}, default_timeline: str,
bold_reading, dogwhistles)
def html_inbox_replies(css_cache: {}, default_timeline: str,
def html_inbox_replies(default_timeline: str,
recent_posts_cache: {}, max_recent_posts: int,
translate: {}, page_number: int, items_per_page: int,
session, base_dir: str,
@ -1551,7 +1551,7 @@ def html_inbox_replies(css_cache: {}, default_timeline: str,
"""Show the replies timeline as html
"""
artist = is_artist(base_dir, nickname)
return html_timeline(css_cache, default_timeline,
return html_timeline(default_timeline,
recent_posts_cache, max_recent_posts,
translate, page_number,
items_per_page, session, base_dir,
@ -1575,7 +1575,7 @@ def html_inbox_replies(css_cache: {}, default_timeline: str,
dogwhistles)
def html_inbox_media(css_cache: {}, default_timeline: str,
def html_inbox_media(default_timeline: str,
recent_posts_cache: {}, max_recent_posts: int,
translate: {}, page_number: int, items_per_page: int,
session, base_dir: str,
@ -1607,7 +1607,7 @@ def html_inbox_media(css_cache: {}, default_timeline: str,
"""Show the media timeline as html
"""
artist = is_artist(base_dir, nickname)
return html_timeline(css_cache, default_timeline,
return html_timeline(default_timeline,
recent_posts_cache, max_recent_posts,
translate, page_number,
items_per_page, session, base_dir,
@ -1631,7 +1631,7 @@ def html_inbox_media(css_cache: {}, default_timeline: str,
dogwhistles)
def html_inbox_blogs(css_cache: {}, default_timeline: str,
def html_inbox_blogs(default_timeline: str,
recent_posts_cache: {}, max_recent_posts: int,
translate: {}, page_number: int, items_per_page: int,
session, base_dir: str,
@ -1663,7 +1663,7 @@ def html_inbox_blogs(css_cache: {}, default_timeline: str,
"""Show the blogs timeline as html
"""
artist = is_artist(base_dir, nickname)
return html_timeline(css_cache, default_timeline,
return html_timeline(default_timeline,
recent_posts_cache, max_recent_posts,
translate, page_number,
items_per_page, session, base_dir,
@ -1687,7 +1687,7 @@ def html_inbox_blogs(css_cache: {}, default_timeline: str,
dogwhistles)
def html_inbox_features(css_cache: {}, default_timeline: str,
def html_inbox_features(default_timeline: str,
recent_posts_cache: {}, max_recent_posts: int,
translate: {}, page_number: int, items_per_page: int,
session, base_dir: str,
@ -1719,7 +1719,7 @@ def html_inbox_features(css_cache: {}, default_timeline: str,
dogwhistles: {}) -> str:
"""Show the features timeline as html
"""
return html_timeline(css_cache, default_timeline,
return html_timeline(default_timeline,
recent_posts_cache, max_recent_posts,
translate, page_number,
items_per_page, session, base_dir,
@ -1743,7 +1743,7 @@ def html_inbox_features(css_cache: {}, default_timeline: str,
dogwhistles)
def html_inbox_news(css_cache: {}, default_timeline: str,
def html_inbox_news(default_timeline: str,
recent_posts_cache: {}, max_recent_posts: int,
translate: {}, page_number: int, items_per_page: int,
session, base_dir: str,
@ -1774,7 +1774,7 @@ def html_inbox_news(css_cache: {}, default_timeline: str,
dogwhistles: {}) -> str:
"""Show the news timeline as html
"""
return html_timeline(css_cache, default_timeline,
return html_timeline(default_timeline,
recent_posts_cache, max_recent_posts,
translate, page_number,
items_per_page, session, base_dir,
@ -1798,7 +1798,7 @@ def html_inbox_news(css_cache: {}, default_timeline: str,
dogwhistles)
def html_outbox(css_cache: {}, default_timeline: str,
def html_outbox(default_timeline: str,
recent_posts_cache: {}, max_recent_posts: int,
translate: {}, page_number: int, items_per_page: int,
session, base_dir: str,
@ -1832,7 +1832,7 @@ def html_outbox(css_cache: {}, default_timeline: str,
manually_approve_followers = \
follower_approval_active(base_dir, nickname, domain)
artist = is_artist(base_dir, nickname)
return html_timeline(css_cache, default_timeline,
return html_timeline(default_timeline,
recent_posts_cache, max_recent_posts,
translate, page_number,
items_per_page, session, base_dir,