Snake case

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

View File

@ -3228,7 +3228,7 @@ def hasObjectString(post_json_object: {}, debug: bool) -> bool:
return False
def getNewPostEndpoints() -> []:
def get_new_post_endpoints() -> []:
"""Returns a list of endpoints for new posts
"""
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
"""
if '://' in faviconUrl:
faviconUrl = faviconUrl.split('://')[1]
if '/favicon.' in faviconUrl:
faviconUrl = faviconUrl.replace('/favicon.', '.')
return base_dir + '/favicons/' + faviconUrl.replace('/', '-')
if '://' in favicon_url:
favicon_url = favicon_url.split('://')[1]
if '/favicon.' in favicon_url:
favicon_url = favicon_url.replace('/favicon.', '.')
return base_dir + '/favicons/' + favicon_url.replace('/', '-')

View File

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