Snake case

main
Bob Mottram 2021-12-28 12:20:18 +00:00
parent 98e787fe1e
commit b33539b32f
2 changed files with 6 additions and 6 deletions

View File

@ -2100,7 +2100,7 @@ def isBlogPost(post_json_object: {}) -> bool:
return True
def isNewsPost(post_json_object: {}) -> bool:
def is_news_post(post_json_object: {}) -> bool:
"""Is the given post a blog post?
"""
return post_json_object.get('news')

View File

@ -42,7 +42,7 @@ from utils import load_json
from utils import get_cached_post_directory
from utils import get_cached_post_filename
from utils import get_protocol_prefixes
from utils import isNewsPost
from utils import is_news_post
from utils import isBlogPost
from utils import get_display_name
from utils import isPublicPost
@ -484,7 +484,7 @@ def _getEditIconHtml(base_dir: str, nickname: str, domain_full: str,
editBlogPostStr = 'Edit blog post'
if translate.get(editBlogPostStr):
editBlogPostStr = translate[editBlogPostStr]
if not isNewsPost(post_json_object):
if not is_news_post(post_json_object):
editStr += \
' ' + \
'<a class="imageAnchor" href="/users/' + \
@ -806,7 +806,7 @@ def _getDeleteIconHtml(nickname: str, domain_full: str,
('/' + domain_full + '/' in postActor and
messageId.startswith(postActor))):
if '/users/' + nickname + '/' in messageId:
if not isNewsPost(post_json_object):
if not is_news_post(post_json_object):
deleteThisPostStr = 'Delete this post'
if translate.get(deleteThisPostStr):
deleteThisPostStr = translate[deleteThisPostStr]
@ -1308,7 +1308,7 @@ def _getFooterWithIcons(showIcons: bool,
footerStr += ' <div class="' + containerClassIcons + '">\n'
footerStr += replyStr + announceStr + likeStr + bookmarkStr + reactionStr
footerStr += deleteStr + muteStr + editStr
if not isNewsPost(post_json_object):
if not is_news_post(post_json_object):
footerStr += ' <a href="' + publishedLink + '" class="' + \
timeClass + '">' + publishedStr + '</a>\n'
else:
@ -1798,7 +1798,7 @@ def individualPostAsHtml(signing_priv_key_pem: str,
domain + ':' + str(port) + '/users/' in publishedLink:
publishedLink = '/users/' + publishedLink.split('/users/')[1]
if not isNewsPost(post_json_object):
if not is_news_post(post_json_object):
footerStr = '<a href="' + publishedLink + \
'" class="' + timeClass + '">' + publishedStr + '</a>\n'
else: