Snake case

merge-requests/30/head
Bob Mottram 2021-12-26 16:59:38 +00:00
parent 7fd45f1fcd
commit 54d903a47c
3 changed files with 12 additions and 12 deletions

View File

@ -244,7 +244,7 @@ from languages import setActorLanguages
from like import updateLikesCollection from like import updateLikesCollection
from reaction import updateReactionCollection from reaction import updateReactionCollection
from utils import undoReactionCollectionEntry from utils import undoReactionCollectionEntry
from utils import getNewPostEndpoints from utils import get_new_post_endpoints
from utils import hasActor from utils import hasActor
from utils import setReplyIntervalHours from utils import setReplyIntervalHours
from utils import canReplyTo from utils import canReplyTo
@ -12940,7 +12940,7 @@ class PubServer(BaseHTTPRequestHandler):
isNewPostEndpoint = False isNewPostEndpoint = False
if '/users/' in path and '/new' in path: if '/users/' in path and '/new' in path:
# Various types of new post in the web interface # Various types of new post in the web interface
newPostEndpoints = getNewPostEndpoints() newPostEndpoints = get_new_post_endpoints()
for currPostType in newPostEndpoints: for currPostType in newPostEndpoints:
if path.endswith('/' + currPostType): if path.endswith('/' + currPostType):
isNewPostEndpoint = True isNewPostEndpoint = True
@ -18008,7 +18008,7 @@ class PubServer(BaseHTTPRequestHandler):
self.server.debug) self.server.debug)
# receive different types of post created by htmlNewPost # receive different types of post created by htmlNewPost
newPostEndpoints = getNewPostEndpoints() newPostEndpoints = get_new_post_endpoints()
for currPostType in newPostEndpoints: for currPostType in newPostEndpoints:
if not authorized: if not authorized:
if self.server.debug: if self.server.debug:

View File

@ -3228,7 +3228,7 @@ def hasObjectString(post_json_object: {}, debug: bool) -> bool:
return False return False
def getNewPostEndpoints() -> []: def get_new_post_endpoints() -> []:
"""Returns a list of endpoints for new posts """Returns a list of endpoints for new posts
""" """
return ( return (
@ -3238,11 +3238,11 @@ def getNewPostEndpoints() -> []:
) )
def get_fav_filename_from_url(base_dir: str, faviconUrl: str) -> str: def get_fav_filename_from_url(base_dir: str, favicon_url: str) -> str:
"""Returns the cached filename for a favicon based upon its url """Returns the cached filename for a favicon based upon its url
""" """
if '://' in faviconUrl: if '://' in favicon_url:
faviconUrl = faviconUrl.split('://')[1] favicon_url = favicon_url.split('://')[1]
if '/favicon.' in faviconUrl: if '/favicon.' in favicon_url:
faviconUrl = faviconUrl.replace('/favicon.', '.') favicon_url = favicon_url.replace('/favicon.', '.')
return base_dir + '/favicons/' + faviconUrl.replace('/', '-') return base_dir + '/favicons/' + favicon_url.replace('/', '-')

View File

@ -8,7 +8,7 @@ __status__ = "Production"
__module_group__ = "Web Interface" __module_group__ = "Web Interface"
import os import os
from utils import getNewPostEndpoints from utils import get_new_post_endpoints
from utils import isPublicPostFromUrl from utils import isPublicPostFromUrl
from utils import getNicknameFromActor from utils import getNicknameFromActor
from utils import getDomainFromActor from utils import getDomainFromActor
@ -350,7 +350,7 @@ def htmlNewPost(cssCache: {}, media_instance: bool, translate: {},
if '?' in path: if '?' in path:
path = path.split('?')[0] path = path.split('?')[0]
newPostEndpoints = getNewPostEndpoints() newPostEndpoints = get_new_post_endpoints()
pathBase = path pathBase = path
for currPostType in newPostEndpoints: for currPostType in newPostEndpoints:
pathBase = pathBase.replace('/' + currPostType, '') pathBase = pathBase.replace('/' + currPostType, '')