mirror of https://gitlab.com/bashrc2/epicyon
Snake case
parent
ae2cef4569
commit
f25d6f9203
16
daemon.py
16
daemon.py
|
@ -275,7 +275,7 @@ from utils import has_users_path
|
|||
from utils import get_full_domain
|
||||
from utils import removeHtml
|
||||
from utils import is_editor
|
||||
from utils import isArtist
|
||||
from utils import is_artist
|
||||
from utils import getImageExtensions
|
||||
from utils import mediaFileMimeType
|
||||
from utils import getCSS
|
||||
|
@ -4802,7 +4802,7 @@ class PubServer(BaseHTTPRequestHandler):
|
|||
|
||||
if mType == 'submitImportTheme':
|
||||
if nickname == adminNickname or \
|
||||
isArtist(base_dir, nickname):
|
||||
is_artist(base_dir, nickname):
|
||||
if importTheme(base_dir, filename):
|
||||
print(nickname + ' uploaded a theme')
|
||||
else:
|
||||
|
@ -5012,7 +5012,7 @@ class PubServer(BaseHTTPRequestHandler):
|
|||
redirectPath = 'previewAvatar'
|
||||
|
||||
if nickname == adminNickname or \
|
||||
isArtist(base_dir, nickname):
|
||||
is_artist(base_dir, nickname):
|
||||
# change theme
|
||||
if fields.get('themeDropdown'):
|
||||
self.server.theme_name = fields['themeDropdown']
|
||||
|
@ -5924,7 +5924,7 @@ class PubServer(BaseHTTPRequestHandler):
|
|||
# remove a custom font
|
||||
if fields.get('removeCustomFont'):
|
||||
if (fields['removeCustomFont'] == 'on' and
|
||||
(isArtist(base_dir, nickname) or
|
||||
(is_artist(base_dir, nickname) or
|
||||
path.startswith('/users/' +
|
||||
adminNickname + '/'))):
|
||||
fontExt = ('woff', 'woff2', 'otf', 'ttf')
|
||||
|
@ -6198,7 +6198,7 @@ class PubServer(BaseHTTPRequestHandler):
|
|||
|
||||
# grayscale theme
|
||||
if path.startswith('/users/' + adminNickname + '/') or \
|
||||
isArtist(base_dir, nickname):
|
||||
is_artist(base_dir, nickname):
|
||||
grayscale = False
|
||||
if fields.get('grayscale'):
|
||||
if fields['grayscale'] == 'on':
|
||||
|
@ -6210,7 +6210,7 @@ class PubServer(BaseHTTPRequestHandler):
|
|||
|
||||
# low bandwidth images checkbox
|
||||
if path.startswith('/users/' + adminNickname + '/') or \
|
||||
isArtist(base_dir, nickname):
|
||||
is_artist(base_dir, nickname):
|
||||
currLowBandwidth = \
|
||||
get_config_param(base_dir, 'low_bandwidth')
|
||||
low_bandwidth = False
|
||||
|
@ -10955,7 +10955,7 @@ class PubServer(BaseHTTPRequestHandler):
|
|||
currNickname = currNickname.split('/')[0]
|
||||
moderator = isModerator(base_dir, currNickname)
|
||||
editor = is_editor(base_dir, currNickname)
|
||||
artist = isArtist(base_dir, currNickname)
|
||||
artist = is_artist(base_dir, currNickname)
|
||||
full_width_tl_button_header = \
|
||||
self.server.full_width_tl_button_header
|
||||
minimalNick = isMinimal(base_dir, domain, nickname)
|
||||
|
@ -14465,7 +14465,7 @@ class PubServer(BaseHTTPRequestHandler):
|
|||
if '/' in nickname:
|
||||
nickname = nickname.split('/')[0]
|
||||
|
||||
if not isArtist(self.server.base_dir, nickname):
|
||||
if not is_artist(self.server.base_dir, nickname):
|
||||
self._403()
|
||||
return
|
||||
|
||||
|
|
2
utils.py
2
utils.py
|
@ -314,7 +314,7 @@ def is_editor(base_dir: str, nickname: str) -> bool:
|
|||
return False
|
||||
|
||||
|
||||
def isArtist(base_dir: str, nickname: str) -> bool:
|
||||
def is_artist(base_dir: str, nickname: str) -> bool:
|
||||
"""Returns true if the given nickname is an artist
|
||||
"""
|
||||
artistsFile = base_dir + '/accounts/artists.txt'
|
||||
|
|
|
@ -11,7 +11,7 @@ import os
|
|||
from utils import get_config_param
|
||||
from utils import getNicknameFromActor
|
||||
from utils import is_editor
|
||||
from utils import isArtist
|
||||
from utils import is_artist
|
||||
from utils import removeDomainPort
|
||||
from utils import local_actor_url
|
||||
from webapp_utils import sharesTimelineJson
|
||||
|
@ -372,7 +372,7 @@ def htmlLinksMobile(cssCache: {}, base_dir: str,
|
|||
artist = False
|
||||
else:
|
||||
editor = is_editor(base_dir, nickname)
|
||||
artist = isArtist(base_dir, nickname)
|
||||
artist = is_artist(base_dir, nickname)
|
||||
|
||||
domain = removeDomainPort(domain_full)
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@ __status__ = "Production"
|
|||
__module_group__ = "Moderation"
|
||||
|
||||
import os
|
||||
from utils import isArtist
|
||||
from utils import is_artist
|
||||
from utils import isAccountDir
|
||||
from utils import get_full_domain
|
||||
from utils import is_editor
|
||||
|
@ -58,7 +58,7 @@ def htmlModeration(cssCache: {}, defaultTimeline: str,
|
|||
"""Show the moderation feed as html
|
||||
This is what you see when selecting the "mod" timeline
|
||||
"""
|
||||
artist = isArtist(base_dir, nickname)
|
||||
artist = is_artist(base_dir, nickname)
|
||||
return htmlTimeline(cssCache, defaultTimeline,
|
||||
recentPostsCache, max_recent_posts,
|
||||
translate, pageNumber,
|
||||
|
|
|
@ -16,7 +16,7 @@ from utils import has_object_dict
|
|||
from utils import getOccupationName
|
||||
from utils import get_locked_account
|
||||
from utils import get_full_domain
|
||||
from utils import isArtist
|
||||
from utils import is_artist
|
||||
from utils import is_dormant
|
||||
from utils import getNicknameFromActor
|
||||
from utils import getDomainFromActor
|
||||
|
@ -888,7 +888,7 @@ def htmlProfile(signing_priv_key_pem: str,
|
|||
menuSkills: userPathStr + '/skills#timeline',
|
||||
menuLogout: '/logout'
|
||||
}
|
||||
if isArtist(base_dir, nickname):
|
||||
if is_artist(base_dir, nickname):
|
||||
menuThemeDesigner = \
|
||||
htmlHideFromScreenReader('🎨') + ' ' + translate['Theme Designer']
|
||||
navLinks[menuThemeDesigner] = userPathStr + '/themedesigner'
|
||||
|
@ -2210,7 +2210,7 @@ def htmlEditProfile(cssCache: {}, translate: {}, base_dir: str, path: str,
|
|||
|
||||
adminNickname = get_config_param(base_dir, 'admin')
|
||||
|
||||
if isArtist(base_dir, nickname) or \
|
||||
if is_artist(base_dir, nickname) or \
|
||||
path.startswith('/users/' + str(adminNickname) + '/'):
|
||||
graphicsStr = _htmlEditProfileGraphicDesign(base_dir, translate)
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@ __module_group__ = "Timeline"
|
|||
import os
|
||||
import time
|
||||
from shutil import copyfile
|
||||
from utils import isArtist
|
||||
from utils import is_artist
|
||||
from utils import dangerousMarkup
|
||||
from utils import get_config_param
|
||||
from utils import get_full_domain
|
||||
|
@ -1149,7 +1149,7 @@ def htmlShares(cssCache: {}, defaultTimeline: str,
|
|||
"""
|
||||
manuallyApproveFollowers = \
|
||||
followerApprovalActive(base_dir, nickname, domain)
|
||||
artist = isArtist(base_dir, nickname)
|
||||
artist = is_artist(base_dir, nickname)
|
||||
|
||||
return htmlTimeline(cssCache, defaultTimeline,
|
||||
recentPostsCache, max_recent_posts,
|
||||
|
@ -1207,7 +1207,7 @@ def htmlWanted(cssCache: {}, defaultTimeline: str,
|
|||
"""
|
||||
manuallyApproveFollowers = \
|
||||
followerApprovalActive(base_dir, nickname, domain)
|
||||
artist = isArtist(base_dir, nickname)
|
||||
artist = is_artist(base_dir, nickname)
|
||||
|
||||
return htmlTimeline(cssCache, defaultTimeline,
|
||||
recentPostsCache, max_recent_posts,
|
||||
|
@ -1266,7 +1266,7 @@ def htmlInbox(cssCache: {}, defaultTimeline: str,
|
|||
"""
|
||||
manuallyApproveFollowers = \
|
||||
followerApprovalActive(base_dir, nickname, domain)
|
||||
artist = isArtist(base_dir, nickname)
|
||||
artist = is_artist(base_dir, nickname)
|
||||
|
||||
return htmlTimeline(cssCache, defaultTimeline,
|
||||
recentPostsCache, max_recent_posts,
|
||||
|
@ -1325,7 +1325,7 @@ def htmlBookmarks(cssCache: {}, defaultTimeline: str,
|
|||
"""
|
||||
manuallyApproveFollowers = \
|
||||
followerApprovalActive(base_dir, nickname, domain)
|
||||
artist = isArtist(base_dir, nickname)
|
||||
artist = is_artist(base_dir, nickname)
|
||||
|
||||
return htmlTimeline(cssCache, defaultTimeline,
|
||||
recentPostsCache, max_recent_posts,
|
||||
|
@ -1381,7 +1381,7 @@ def htmlInboxDMs(cssCache: {}, defaultTimeline: str,
|
|||
cw_lists: {}, lists_enabled: str) -> str:
|
||||
"""Show the DM timeline as html
|
||||
"""
|
||||
artist = isArtist(base_dir, nickname)
|
||||
artist = is_artist(base_dir, nickname)
|
||||
return htmlTimeline(cssCache, defaultTimeline,
|
||||
recentPostsCache, max_recent_posts,
|
||||
translate, pageNumber,
|
||||
|
@ -1435,7 +1435,7 @@ def htmlInboxReplies(cssCache: {}, defaultTimeline: str,
|
|||
cw_lists: {}, lists_enabled: str) -> str:
|
||||
"""Show the replies timeline as html
|
||||
"""
|
||||
artist = isArtist(base_dir, nickname)
|
||||
artist = is_artist(base_dir, nickname)
|
||||
return htmlTimeline(cssCache, defaultTimeline,
|
||||
recentPostsCache, max_recent_posts,
|
||||
translate, pageNumber,
|
||||
|
@ -1488,7 +1488,7 @@ def htmlInboxMedia(cssCache: {}, defaultTimeline: str,
|
|||
cw_lists: {}, lists_enabled: str) -> str:
|
||||
"""Show the media timeline as html
|
||||
"""
|
||||
artist = isArtist(base_dir, nickname)
|
||||
artist = is_artist(base_dir, nickname)
|
||||
return htmlTimeline(cssCache, defaultTimeline,
|
||||
recentPostsCache, max_recent_posts,
|
||||
translate, pageNumber,
|
||||
|
@ -1541,7 +1541,7 @@ def htmlInboxBlogs(cssCache: {}, defaultTimeline: str,
|
|||
cw_lists: {}, lists_enabled: str) -> str:
|
||||
"""Show the blogs timeline as html
|
||||
"""
|
||||
artist = isArtist(base_dir, nickname)
|
||||
artist = is_artist(base_dir, nickname)
|
||||
return htmlTimeline(cssCache, defaultTimeline,
|
||||
recentPostsCache, max_recent_posts,
|
||||
translate, pageNumber,
|
||||
|
@ -1701,7 +1701,7 @@ def htmlOutbox(cssCache: {}, defaultTimeline: str,
|
|||
"""
|
||||
manuallyApproveFollowers = \
|
||||
followerApprovalActive(base_dir, nickname, domain)
|
||||
artist = isArtist(base_dir, nickname)
|
||||
artist = is_artist(base_dir, nickname)
|
||||
return htmlTimeline(cssCache, defaultTimeline,
|
||||
recentPostsCache, max_recent_posts,
|
||||
translate, pageNumber,
|
||||
|
|
Loading…
Reference in New Issue