diff --git a/daemon.py b/daemon.py index bdadc25fc..10531b7ee 100644 --- a/daemon.py +++ b/daemon.py @@ -288,7 +288,7 @@ from utils import get_config_param from utils import remove_id_ending from utils import undo_likes_collection_entry from utils import deletePost -from utils import isBlogPost +from utils import is_blog_post from utils import remove_avatar_from_cache from utils import locate_post from utils import get_cached_post_filename @@ -14175,7 +14175,7 @@ class PubServer(BaseHTTPRequestHandler): self.path) if blogFilename and nickname: post_json_object = load_json(blogFilename) - if isBlogPost(post_json_object): + if is_blog_post(post_json_object): msg = htmlBlogPost(self.server.session, authorized, self.server.base_dir, diff --git a/inbox.py b/inbox.py index 80b8a0d0f..3e34c00fa 100644 --- a/inbox.py +++ b/inbox.py @@ -41,7 +41,7 @@ from utils import valid_post_date from utils import get_full_domain from utils import remove_id_ending from utils import get_protocol_prefixes -from utils import isBlogPost +from utils import is_blog_post from utils import remove_avatar_from_cache from utils import isPublicPost from utils import get_cached_post_filename @@ -3522,7 +3522,7 @@ def _inboxAfterInitial(recent_posts_cache: {}, max_recent_posts: int, domain_full, person_cache, signing_priv_key_pem): # media index will be updated updateIndexList.append('tlmedia') - if isBlogPost(post_json_object): + if is_blog_post(post_json_object): # blogs index will be updated updateIndexList.append('tlblogs') diff --git a/newswire.py b/newswire.py index e4c34d2bb..594da5801 100644 --- a/newswire.py +++ b/newswire.py @@ -966,7 +966,7 @@ def _isNewswireBlogPost(post_json_object: {}) -> bool: """Is the given object a blog post? There isn't any difference between a blog post and a newswire blog post but we may here need to check for different properties than - isBlogPost does + is_blog_post does """ if not post_json_object: return False diff --git a/utils.py b/utils.py index ae3b40cd2..e925dcafa 100644 --- a/utils.py +++ b/utils.py @@ -1461,8 +1461,8 @@ def can_reply_to(base_dir: str, nickname: str, domain: str, return True -def _removeAttachment(base_dir: str, http_prefix: str, domain: str, - post_json: {}): +def _remove_attachment(base_dir: str, http_prefix: str, domain: str, + post_json: {}): if not post_json.get('attachment'): return if not post_json['attachment'][0].get('url'): @@ -1476,14 +1476,14 @@ def _removeAttachment(base_dir: str, http_prefix: str, domain: str, try: os.remove(media_filename) except OSError: - print('EX: _removeAttachment unable to delete media file ' + + print('EX: _remove_attachment unable to delete media file ' + str(media_filename)) etag_filename = media_filename + '.etag' if os.path.isfile(etag_filename): try: os.remove(etag_filename) except OSError: - print('EX: _removeAttachment unable to delete etag file ' + + print('EX: _remove_attachment unable to delete etag file ' + str(etag_filename)) post_json['attachment'] = [] @@ -1752,7 +1752,7 @@ def deletePost(base_dir: str, http_prefix: str, _deleteConversationPost(base_dir, nickname, domain, post_json_object) # remove any attachment - _removeAttachment(base_dir, http_prefix, domain, post_json_object) + _remove_attachment(base_dir, http_prefix, domain, post_json_object) extensions = ('votes', 'arrived', 'muted', 'tts', 'reject') for ext in extensions: @@ -2084,7 +2084,7 @@ def getCSS(base_dir: str, css_filename: str, cssCache: {}) -> str: return None -def isBlogPost(post_json_object: {}) -> bool: +def is_blog_post(post_json_object: {}) -> bool: """Is the given post a blog post? """ if post_json_object['type'] != 'Create': diff --git a/webapp_post.py b/webapp_post.py index e8fc4fd98..6d1ee5a08 100644 --- a/webapp_post.py +++ b/webapp_post.py @@ -43,7 +43,7 @@ from utils import get_cached_post_directory from utils import get_cached_post_filename from utils import get_protocol_prefixes from utils import is_news_post -from utils import isBlogPost +from utils import is_blog_post from utils import get_display_name from utils import isPublicPost from utils import updateRecentPostsCache @@ -480,7 +480,7 @@ def _getEditIconHtml(base_dir: str, nickname: str, domain_full: str, if '/statuses/' not in post_id: return editStr - if isBlogPost(post_json_object): + if is_blog_post(post_json_object): editBlogPostStr = 'Edit blog post' if translate.get(editBlogPostStr): editBlogPostStr = translate[editBlogPostStr] @@ -1788,7 +1788,7 @@ def individualPostAsHtml(signing_priv_key_pem: str, publishedLink = messageId # blog posts should have no /statuses/ in their link - if isBlogPost(post_json_object): + if is_blog_post(post_json_object): # is this a post to the local domain? if '://' + domain in messageId: publishedLink = messageId.replace('/statuses/', '/') @@ -1924,7 +1924,7 @@ def individualPostAsHtml(signing_priv_key_pem: str, cwContentStr, post_json_object, pageNumber) cwContentStr = \ switchWords(base_dir, nickname, domain, cwContentStr) - if not isBlogPost(post_json_object): + if not is_blog_post(post_json_object): # get the content warning button contentStr += \ getContentWarningButton(postID, translate, cwContentStr)