Snake case

main
Bob Mottram 2021-12-31 23:50:29 +00:00
parent 0a3d10b2ca
commit a687cee0d2
12 changed files with 319 additions and 314 deletions

544
daemon.py

File diff suppressed because it is too large Load Diff

View File

@ -43,7 +43,7 @@ def html_access_keys(css_cache: {}, base_dir: str,
nickname: str, domain: str,
translate: {}, access_keys: {},
defaultAccessKeys: {},
defaultTimeline: str) -> str:
default_timeline: str) -> str:
"""Show and edit key shortcuts
"""
access_keysFilename = \

View File

@ -356,7 +356,7 @@ def html_links_mobile(css_cache: {}, base_dir: str,
timelinePath: str, authorized: bool,
rss_icon_at_top: bool,
icons_as_buttons: bool,
defaultTimeline: str,
default_timeline: str,
theme: str, access_keys: {},
shared_items_federated_domains: []) -> str:
"""Show the left column links within mobile view
@ -385,7 +385,7 @@ def html_links_mobile(css_cache: {}, base_dir: str,
banner_file, banner_filename = \
get_banner_file(base_dir, nickname, domain, theme)
html_str += \
'<a href="/users/' + nickname + '/' + defaultTimeline + '" ' + \
'<a href="/users/' + nickname + '/' + default_timeline + '" ' + \
'accesskey="' + access_keys['menuTimeline'] + '">' + \
'<img loading="lazy" class="timeline-banner" ' + \
'alt="' + translate['Switch to timeline view'] + '" ' + \
@ -418,7 +418,7 @@ def html_links_mobile(css_cache: {}, base_dir: str,
def html_edit_links(css_cache: {}, translate: {}, base_dir: str, path: str,
domain: str, port: int, http_prefix: str,
defaultTimeline: str, theme: str,
default_timeline: str, theme: str,
access_keys: {}) -> str:
"""Shows the edit links screen
"""
@ -451,7 +451,8 @@ def html_edit_links(css_cache: {}, translate: {}, base_dir: str, path: str,
# top banner
edit_links_form += \
'<header>\n' + \
'<a href="/users/' + nickname + '/' + defaultTimeline + '" title="' + \
'<a href="/users/' + nickname + '/' + default_timeline + \
'" title="' + \
translate['Switch to timeline view'] + '" alt="' + \
translate['Switch to timeline view'] + '" ' + \
'accesskey="' + access_keys['menuTimeline'] + '">\n'

View File

@ -59,7 +59,7 @@ def get_right_column_content(base_dir: str, nickname: str, domain_full: str,
authorized: bool,
showHeaderImage: bool,
theme: str,
defaultTimeline: str,
default_timeline: str,
access_keys: {}) -> str:
"""Returns html content for the right column
"""
@ -71,7 +71,7 @@ def get_right_column_content(base_dir: str, nickname: str, domain_full: str,
# only show the publish button if logged in, otherwise replace it with
# a login button
titleStr = translate['Publish a blog article']
if defaultTimeline == 'tlfeatures':
if default_timeline == 'tlfeatures':
titleStr = translate['Publish a news article']
publishButtonStr = \
' <a href="' + \
@ -174,7 +174,7 @@ def get_right_column_content(base_dir: str, nickname: str, domain_full: str,
if showPublishButton:
if show_publish_as_icon:
titleStr = translate['Publish a blog article']
if defaultTimeline == 'tlfeatures':
if default_timeline == 'tlfeatures':
titleStr = translate['Publish a news article']
htmlStr += \
' <a href="' + \
@ -330,7 +330,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, defaultTimeline: str,
http_prefix: str, default_timeline: str,
translate: {}, newswire: {}, css_cache: {},
blogTitle: str, blogContent: str,
blogImageFilename: str,
@ -456,7 +456,7 @@ def html_newswire_mobile(css_cache: {}, base_dir: str, nickname: str,
authorized: bool,
rss_icon_at_top: bool,
icons_as_buttons: bool,
defaultTimeline: str,
default_timeline: str,
theme: str,
access_keys: {}) -> str:
"""Shows the mobile version of the newswire right column
@ -488,7 +488,7 @@ def html_newswire_mobile(css_cache: {}, base_dir: str, nickname: str,
banner_file, banner_filename = \
get_banner_file(base_dir, nickname, domain, theme)
htmlStr += \
'<a href="/users/' + nickname + '/' + defaultTimeline + '" ' + \
'<a href="/users/' + nickname + '/' + default_timeline + '" ' + \
'accesskey="' + access_keys['menuTimeline'] + '">' + \
'<img loading="lazy" class="timeline-banner" ' + \
'alt="' + translate['Timeline banner image'] + '" ' + \
@ -508,7 +508,7 @@ def html_newswire_mobile(css_cache: {}, base_dir: str, nickname: str,
False, timelinePath, showPublishButton,
show_publish_as_icon, rss_icon_at_top, False,
authorized, False, theme,
defaultTimeline, access_keys)
default_timeline, access_keys)
if editor and not newswire:
htmlStr += '<br><br><br>\n'
htmlStr += '<center>\n '
@ -523,7 +523,7 @@ def html_newswire_mobile(css_cache: {}, base_dir: str, nickname: str,
def html_edit_newswire(css_cache: {}, translate: {}, base_dir: str, path: str,
domain: str, port: int, http_prefix: str,
defaultTimeline: str, theme: str,
default_timeline: str, theme: str,
access_keys: {}) -> str:
"""Shows the edit newswire screen
"""
@ -556,7 +556,8 @@ def html_edit_newswire(css_cache: {}, translate: {}, base_dir: str, path: str,
# top banner
editNewswireForm += \
'<header>' + \
'<a href="/users/' + nickname + '/' + defaultTimeline + '" title="' + \
'<a href="/users/' + nickname + '/' + default_timeline + \
'" title="' + \
translate['Switch to timeline view'] + '" alt="' + \
translate['Switch to timeline view'] + '" ' + \
'accesskey="' + access_keys['menuTimeline'] + '">\n'

View File

@ -70,7 +70,7 @@ def _html_new_post_drop_down(scopeIcon: str, scopeDescription: str,
replyStr: str,
translate: {},
showPublicOnDropdown: bool,
defaultTimeline: str,
default_timeline: str,
pathBase: str,
dropdownNewPostSuffix: str,
dropdownNewBlogSuffix: str,
@ -105,7 +105,7 @@ def _html_new_post_drop_down(scopeIcon: str, scopeDescription: str,
'icons/scope_public.png"/><b>' + \
translate['Public'] + '</b><br>' + \
translate['Visible to anyone'] + '</a></li>\n'
if defaultTimeline == 'tlfeatures':
if default_timeline == 'tlfeatures':
dropDownContent += \
'<li><a href="' + pathBase + dropdownNewBlogSuffix + \
'" accesskey="' + access_keys['menuBlogs'] + '">' + \
@ -193,7 +193,7 @@ def html_new_post(css_cache: {}, media_instance: bool, translate: {},
category: str,
nickname: str, domain: str,
domain_full: str,
defaultTimeline: str, newswire: {},
default_timeline: str, newswire: {},
theme: str, noDropDown: bool,
access_keys: {}, customSubmitText: str,
conversationId: str,
@ -395,7 +395,7 @@ def html_new_post(css_cache: {}, media_instance: bool, translate: {},
if path.endswith('/newblog'):
placeholderSubject = translate['Title']
scopeIcon = 'scope_blog.png'
if defaultTimeline != 'tlfeatures':
if default_timeline != 'tlfeatures':
scopeDescription = translate['Blog']
else:
scopeDescription = translate['Article']
@ -643,7 +643,8 @@ def html_new_post(css_cache: {}, media_instance: bool, translate: {},
newPostForm += \
'<header>\n' + \
'<a href="/users/' + nickname + '/' + defaultTimeline + '" title="' + \
'<a href="/users/' + nickname + '/' + default_timeline + \
'" title="' + \
translate['Switch to timeline view'] + '" alt="' + \
translate['Switch to timeline view'] + '" ' + \
'accesskey="' + access_keys['menuTimeline'] + '">\n'
@ -712,7 +713,7 @@ def html_new_post(css_cache: {}, media_instance: bool, translate: {},
replyStr,
translate,
showPublicOnDropdown,
defaultTimeline,
default_timeline,
pathBase,
dropdownNewPostSuffix,
dropdownNewBlogSuffix,

View File

@ -97,7 +97,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,
defaultTimeline: str,
default_timeline: str,
recent_posts_cache: {}, max_recent_posts: int,
translate: {}, project_version: str,
base_dir: str, http_prefix: str, authorized: bool,
@ -199,7 +199,7 @@ def html_front_screen(signing_priv_key_pem: str,
False, False, newswire, False,
False, None, False, False,
False, True, authorized, True, theme,
defaultTimeline, access_keys)
default_timeline, access_keys)
profileFooterStr += \
' </td>\n' + \
' </tr>\n' + \

View File

@ -17,7 +17,7 @@ from happening import day_events_check
from webapp_utils import html_highlight_label
def header_buttons_timeline(defaultTimeline: str,
def header_buttons_timeline(default_timeline: str,
boxName: str,
pageNumber: int,
translate: {},
@ -54,20 +54,20 @@ def header_buttons_timeline(defaultTimeline: str,
# start of the button header with inbox, outbox, etc
tlStr = '<div class="containerHeader"><nav>\n'
# first button
if defaultTimeline == 'tlmedia':
if default_timeline == 'tlmedia':
tlStr += \
'<a href="' + usersPath + '/tlmedia" tabindex="-1" ' + \
'accesskey="' + access_keys['menuMedia'] + '"' + \
'><button class="' + \
mediaButton + '"><span>' + translate['Media'] + \
'</span></button></a>'
elif defaultTimeline == 'tlblogs':
elif default_timeline == 'tlblogs':
tlStr += \
'<a href="' + usersPath + \
'/tlblogs" tabindex="-1"><button class="' + \
blogsButton + '"><span>' + translate['Blogs'] + \
'</span></button></a>'
elif defaultTimeline == 'tlfeatures':
elif default_timeline == 'tlfeatures':
tlStr += \
'<a href="' + usersPath + \
'/tlfeatures" tabindex="-1"><button class="' + \
@ -82,7 +82,7 @@ def header_buttons_timeline(defaultTimeline: str,
# if this is a news instance and we are viewing the news timeline
featuresHeader = False
if defaultTimeline == 'tlfeatures' and boxName == 'tlfeatures':
if default_timeline == 'tlfeatures' and boxName == 'tlfeatures':
featuresHeader = True
if not featuresHeader:
@ -102,7 +102,7 @@ def header_buttons_timeline(defaultTimeline: str,
'</span></button></a>'
# typically the media button
if defaultTimeline != 'tlmedia':
if default_timeline != 'tlmedia':
if not minimal and not featuresHeader:
tlStr += \
'<a href="' + usersPath + '/tlmedia" tabindex="-1" ' + \
@ -121,10 +121,10 @@ def header_buttons_timeline(defaultTimeline: str,
if not featuresHeader:
# typically the blogs button
# but may change if this is a blogging oriented instance
if defaultTimeline != 'tlblogs':
if default_timeline != 'tlblogs':
if not minimal:
titleStr = translate['Blogs']
if defaultTimeline == 'tlfeatures':
if default_timeline == 'tlfeatures':
titleStr = translate['Article']
tlStr += \
'<a href="' + usersPath + \
@ -141,7 +141,7 @@ def header_buttons_timeline(defaultTimeline: str,
# typically the news button
# but may change if this is a news oriented instance
if defaultTimeline == 'tlfeatures':
if default_timeline == 'tlfeatures':
if not featuresHeader:
tlStr += \
'<a href="' + usersPath + \

View File

@ -30,7 +30,7 @@ from blocking import is_blocked
from session import create_session
def html_moderation(css_cache: {}, defaultTimeline: str,
def html_moderation(css_cache: {}, default_timeline: str,
recent_posts_cache: {}, max_recent_posts: int,
translate: {}, pageNumber: int, itemsPerPage: int,
session, base_dir: str, wfRequest: {}, person_cache: {},
@ -59,7 +59,7 @@ def html_moderation(css_cache: {}, defaultTimeline: str,
This is what you see when selecting the "mod" timeline
"""
artist = is_artist(base_dir, nickname)
return html_timeline(css_cache, defaultTimeline,
return html_timeline(css_cache, default_timeline,
recent_posts_cache, max_recent_posts,
translate, pageNumber,
itemsPerPage, session, base_dir,

View File

@ -31,7 +31,7 @@ from webapp_utils import get_broken_link_substitute
from webapp_utils import html_keyboard_navigation
def html_person_options(defaultTimeline: str,
def html_person_options(default_timeline: str,
css_cache: {}, translate: {}, base_dir: str,
domain: str, domain_full: str,
originPathStr: str,
@ -352,7 +352,7 @@ def html_person_options(defaultTimeline: str,
optionsStr += optionsLinkStr
backPath = '/'
if nickname:
backPath = '/users/' + nickname + '/' + defaultTimeline
backPath = '/users/' + nickname + '/' + default_timeline
if 'moderation' in backToPath:
backPath = '/users/' + nickname + '/moderation'
if authorized and originPathStr == '/users/' + nickname:

View File

@ -374,7 +374,7 @@ def html_search_emoji_text_entry(css_cache: {}, translate: {},
def html_search(css_cache: {}, translate: {},
base_dir: str, path: str, domain: str,
defaultTimeline: str, theme: str,
default_timeline: str, theme: str,
text_mode_banner: str, access_keys: {}) -> str:
"""Search called from the timeline icon
"""
@ -404,7 +404,7 @@ def html_search(css_cache: {}, translate: {},
usersPath = '/users/' + searchNickname
followStr += \
'<header>\n' + text_mode_bannerStr + \
'<a href="' + usersPath + '/' + defaultTimeline + '" title="' + \
'<a href="' + usersPath + '/' + default_timeline + '" title="' + \
translate['Switch to timeline view'] + '" alt="' + \
translate['Switch to timeline view'] + '" ' + \
'accesskey="' + timelineKey + '">\n'

View File

@ -168,7 +168,7 @@ color_to_hex = {
def html_theme_designer(css_cache: {}, base_dir: str,
nickname: str, domain: str,
translate: {}, defaultTimeline: str,
translate: {}, default_timeline: str,
theme_name: str, access_keys: {}) -> str:
"""Edit theme settings
"""
@ -197,7 +197,7 @@ def html_theme_designer(css_cache: {}, base_dir: str,
banner_file, banner_filename = \
get_banner_file(base_dir, nickname, domain, theme_name)
themeForm += \
'<a href="/users/' + nickname + '/' + defaultTimeline + '" ' + \
'<a href="/users/' + nickname + '/' + default_timeline + '" ' + \
'accesskey="' + access_keys['menuTimeline'] + '">' + \
'<img loading="lazy" class="timeline-banner" ' + \
'title="' + translate['Switch to timeline view'] + '" ' + \

View File

@ -1504,7 +1504,7 @@ def html_show_share(base_dir: str, domain: str, nickname: str,
http_prefix: str, domain_full: str,
itemID: str, translate: {},
shared_items_federated_domains: [],
defaultTimeline: str, theme: str,
default_timeline: str, theme: str,
sharesFileType: str, category: str) -> str:
"""Shows an individual shared item after selecting it from the left column
"""
@ -1562,7 +1562,7 @@ def html_show_share(base_dir: str, domain: str, nickname: str,
shareStr = \
'<header>\n' + \
'<a href="/users/' + nickname + '/' + \
defaultTimeline + '" title="" alt="">\n'
default_timeline + '" title="" alt="">\n'
shareStr += '<img loading="lazy" class="timeline-banner" ' + \
'alt="" ' + \
'src="/users/' + nickname + '/' + banner_file + '" /></a>\n' + \