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