mirror of https://gitlab.com/bashrc2/epicyon
Snake case
parent
e03417ef54
commit
bb86551e1c
|
@ -16,7 +16,7 @@ from utils import has_object_string_object
|
|||
from utils import has_object_stringType
|
||||
from utils import remove_domain_port
|
||||
from utils import has_object_dict
|
||||
from utils import isAccountDir
|
||||
from utils import is_account_dir
|
||||
from utils import getCachedPostFilename
|
||||
from utils import load_json
|
||||
from utils import save_json
|
||||
|
@ -910,7 +910,7 @@ def setBrochMode(base_dir: str, domain_full: str, enabled: bool) -> None:
|
|||
follow_files = ('following.txt', 'followers.txt')
|
||||
for subdir, dirs, files in os.walk(base_dir + '/accounts'):
|
||||
for acct in dirs:
|
||||
if not isAccountDir(acct):
|
||||
if not is_account_dir(acct):
|
||||
continue
|
||||
accountDir = os.path.join(base_dir + '/accounts', acct)
|
||||
for followFileType in follow_files:
|
||||
|
|
8
blog.py
8
blog.py
|
@ -21,7 +21,7 @@ from utils import local_actor_url
|
|||
from utils import get_actor_languages_list
|
||||
from utils import get_base_content_from_post
|
||||
from utils import get_content_from_post
|
||||
from utils import isAccountDir
|
||||
from utils import is_account_dir
|
||||
from utils import removeHtml
|
||||
from utils import get_config_param
|
||||
from utils import get_full_domain
|
||||
|
@ -702,7 +702,7 @@ def _noOfBlogAccounts(base_dir: str) -> int:
|
|||
ctr = 0
|
||||
for subdir, dirs, files in os.walk(base_dir + '/accounts'):
|
||||
for acct in dirs:
|
||||
if not isAccountDir(acct):
|
||||
if not is_account_dir(acct):
|
||||
continue
|
||||
accountDir = os.path.join(base_dir + '/accounts', acct)
|
||||
blogsIndex = accountDir + '/tlblogs.index'
|
||||
|
@ -717,7 +717,7 @@ def _singleBlogAccountNickname(base_dir: str) -> str:
|
|||
"""
|
||||
for subdir, dirs, files in os.walk(base_dir + '/accounts'):
|
||||
for acct in dirs:
|
||||
if not isAccountDir(acct):
|
||||
if not is_account_dir(acct):
|
||||
continue
|
||||
accountDir = os.path.join(base_dir + '/accounts', acct)
|
||||
blogsIndex = accountDir + '/tlblogs.index'
|
||||
|
@ -757,7 +757,7 @@ def htmlBlogView(authorized: bool,
|
|||
|
||||
for subdir, dirs, files in os.walk(base_dir + '/accounts'):
|
||||
for acct in dirs:
|
||||
if not isAccountDir(acct):
|
||||
if not is_account_dir(acct):
|
||||
continue
|
||||
accountDir = os.path.join(base_dir + '/accounts', acct)
|
||||
blogsIndex = accountDir + '/tlblogs.index'
|
||||
|
|
|
@ -262,7 +262,7 @@ from utils import has_object_dict
|
|||
from utils import user_agent_domain
|
||||
from utils import isLocalNetworkAddress
|
||||
from utils import permitted_dir
|
||||
from utils import isAccountDir
|
||||
from utils import is_account_dir
|
||||
from utils import getOccupationSkills
|
||||
from utils import getOccupationName
|
||||
from utils import setOccupationName
|
||||
|
@ -6911,7 +6911,7 @@ class PubServer(BaseHTTPRequestHandler):
|
|||
msg = ''
|
||||
for subdir, dirs, files in os.walk(base_dir + '/accounts'):
|
||||
for acct in dirs:
|
||||
if not isAccountDir(acct):
|
||||
if not is_account_dir(acct):
|
||||
continue
|
||||
nickname = acct.split('@')[0]
|
||||
domain = acct.split('@')[1]
|
||||
|
|
|
@ -25,7 +25,7 @@ from posts import sendSignedJson
|
|||
from posts import getPersonBox
|
||||
from utils import load_json
|
||||
from utils import save_json
|
||||
from utils import isAccountDir
|
||||
from utils import is_account_dir
|
||||
from utils import get_user_paths
|
||||
from utils import acct_dir
|
||||
from utils import has_group_type
|
||||
|
@ -45,7 +45,7 @@ def createInitialLastSeen(base_dir: str, http_prefix: str) -> None:
|
|||
"""
|
||||
for subdir, dirs, files in os.walk(base_dir + '/accounts'):
|
||||
for acct in dirs:
|
||||
if not isAccountDir(acct):
|
||||
if not is_account_dir(acct):
|
||||
continue
|
||||
accountDir = os.path.join(base_dir + '/accounts', acct)
|
||||
followingFilename = accountDir + '/following.txt'
|
||||
|
|
|
@ -8,7 +8,7 @@ __status__ = "Production"
|
|||
__module_group__ = "Metadata"
|
||||
|
||||
import os
|
||||
from utils import isAccountDir
|
||||
from utils import is_account_dir
|
||||
from utils import load_json
|
||||
from utils import noOfAccounts
|
||||
from utils import noOfActiveAccountsMonthly
|
||||
|
@ -21,7 +21,7 @@ def _getStatusCount(base_dir: str) -> int:
|
|||
accountsDir = base_dir + '/accounts'
|
||||
for subdir, dirs, files in os.walk(accountsDir):
|
||||
for acct in dirs:
|
||||
if not isAccountDir(acct):
|
||||
if not is_account_dir(acct):
|
||||
continue
|
||||
acct_dir = os.path.join(accountsDir, acct + '/outbox')
|
||||
for subdir2, dirs2, files2 in os.walk(acct_dir):
|
||||
|
|
|
@ -8,7 +8,7 @@ __status__ = "Production"
|
|||
__module_group__ = "Core"
|
||||
|
||||
import os
|
||||
from utils import isAccountDir
|
||||
from utils import is_account_dir
|
||||
from utils import getNicknameFromActor
|
||||
from utils import getDomainFromActor
|
||||
from utils import acct_dir
|
||||
|
@ -184,7 +184,7 @@ def migrateAccounts(base_dir: str, session,
|
|||
ctr = 0
|
||||
for subdir, dirs, files in os.walk(base_dir + '/accounts'):
|
||||
for handle in dirs:
|
||||
if not isAccountDir(handle):
|
||||
if not is_account_dir(handle):
|
||||
continue
|
||||
nickname = handle.split('@')[0]
|
||||
domain = handle.split('@')[1]
|
||||
|
|
|
@ -30,7 +30,7 @@ from utils import save_json
|
|||
from utils import isSuspended
|
||||
from utils import containsInvalidChars
|
||||
from utils import removeHtml
|
||||
from utils import isAccountDir
|
||||
from utils import is_account_dir
|
||||
from utils import acct_dir
|
||||
from utils import local_actor_url
|
||||
from blocking import isBlockedDomain
|
||||
|
@ -1093,7 +1093,7 @@ def _addBlogsToNewswire(base_dir: str, domain: str, newswire: {},
|
|||
# go through each account
|
||||
for subdir, dirs, files in os.walk(base_dir + '/accounts'):
|
||||
for handle in dirs:
|
||||
if not isAccountDir(handle):
|
||||
if not is_account_dir(handle):
|
||||
continue
|
||||
|
||||
nickname = handle.split('@')[0]
|
||||
|
|
|
@ -13,7 +13,7 @@ import datetime
|
|||
from utils import has_object_dict
|
||||
from utils import getStatusNumber
|
||||
from utils import load_json
|
||||
from utils import isAccountDir
|
||||
from utils import is_account_dir
|
||||
from utils import acct_dir
|
||||
from outbox import postMessageToOutbox
|
||||
|
||||
|
@ -167,7 +167,7 @@ def runPostSchedule(base_dir: str, httpd, maxScheduledPosts: int):
|
|||
for account in dirs:
|
||||
if '@' not in account:
|
||||
continue
|
||||
if not isAccountDir(account):
|
||||
if not is_account_dir(account):
|
||||
continue
|
||||
# scheduled posts index for this account
|
||||
scheduleIndexFilename = \
|
||||
|
|
|
@ -32,7 +32,7 @@ from utils import load_json
|
|||
from utils import save_json
|
||||
from utils import get_image_extensions
|
||||
from utils import remove_domain_port
|
||||
from utils import isAccountDir
|
||||
from utils import is_account_dir
|
||||
from utils import acct_dir
|
||||
from utils import is_float
|
||||
from utils import get_category_types
|
||||
|
@ -271,7 +271,7 @@ def _indicateNewShareAvailable(base_dir: str, http_prefix: str,
|
|||
"""
|
||||
for subdir, dirs, files in os.walk(base_dir + '/accounts'):
|
||||
for handle in dirs:
|
||||
if not isAccountDir(handle):
|
||||
if not is_account_dir(handle):
|
||||
continue
|
||||
accountDir = base_dir + '/accounts/' + handle
|
||||
if sharesFileType == 'shares':
|
||||
|
@ -401,7 +401,7 @@ def expireShares(base_dir: str) -> None:
|
|||
"""
|
||||
for subdir, dirs, files in os.walk(base_dir + '/accounts'):
|
||||
for account in dirs:
|
||||
if not isAccountDir(account):
|
||||
if not is_account_dir(account):
|
||||
continue
|
||||
nickname = account.split('@')[0]
|
||||
domain = account.split('@')[1]
|
||||
|
@ -1279,7 +1279,7 @@ def sharesCatalogEndpoint(base_dir: str, http_prefix: str,
|
|||
|
||||
for subdir, dirs, files in os.walk(base_dir + '/accounts'):
|
||||
for acct in dirs:
|
||||
if not isAccountDir(acct):
|
||||
if not is_account_dir(acct):
|
||||
continue
|
||||
nickname = acct.split('@')[0]
|
||||
domain = acct.split('@')[1]
|
||||
|
|
4
theme.py
4
theme.py
|
@ -8,7 +8,7 @@ __status__ = "Production"
|
|||
__module_group__ = "Web Interface"
|
||||
|
||||
import os
|
||||
from utils import isAccountDir
|
||||
from utils import is_account_dir
|
||||
from utils import load_json
|
||||
from utils import save_json
|
||||
from utils import get_image_extensions
|
||||
|
@ -683,7 +683,7 @@ def _setThemeImages(base_dir: str, name: str) -> None:
|
|||
|
||||
for subdir, dirs, files in os.walk(base_dir + '/accounts'):
|
||||
for acct in dirs:
|
||||
if not isAccountDir(acct):
|
||||
if not is_account_dir(acct):
|
||||
continue
|
||||
accountDir = os.path.join(base_dir + '/accounts', acct)
|
||||
|
||||
|
|
6
utils.py
6
utils.py
|
@ -1912,7 +1912,7 @@ def noOfAccounts(base_dir: str) -> bool:
|
|||
accountCtr = 0
|
||||
for subdir, dirs, files in os.walk(base_dir + '/accounts'):
|
||||
for account in dirs:
|
||||
if isAccountDir(account):
|
||||
if is_account_dir(account):
|
||||
accountCtr += 1
|
||||
break
|
||||
return accountCtr
|
||||
|
@ -1926,7 +1926,7 @@ def noOfActiveAccountsMonthly(base_dir: str, months: int) -> bool:
|
|||
monthSeconds = int(60*60*24*30*months)
|
||||
for subdir, dirs, files in os.walk(base_dir + '/accounts'):
|
||||
for account in dirs:
|
||||
if not isAccountDir(account):
|
||||
if not is_account_dir(account):
|
||||
continue
|
||||
lastUsedFilename = \
|
||||
base_dir + '/accounts/' + account + '/.lastUsed'
|
||||
|
@ -2805,7 +2805,7 @@ def setOccupationSkillsList(actor_json: {}, skillsList: []) -> bool:
|
|||
return False
|
||||
|
||||
|
||||
def isAccountDir(dirName: str) -> bool:
|
||||
def is_account_dir(dirName: str) -> bool:
|
||||
"""Is the given directory an account within /accounts ?
|
||||
"""
|
||||
if '@' not in dirName:
|
||||
|
|
|
@ -8,7 +8,7 @@ __status__ = "Production"
|
|||
__module_group__ = "Accessibility"
|
||||
|
||||
import os
|
||||
from utils import isAccountDir
|
||||
from utils import is_account_dir
|
||||
from utils import load_json
|
||||
from utils import get_config_param
|
||||
from utils import acct_dir
|
||||
|
@ -22,7 +22,7 @@ def loadAccessKeysForAccounts(base_dir: str, keyShortcuts: {},
|
|||
"""
|
||||
for subdir, dirs, files in os.walk(base_dir + '/accounts'):
|
||||
for acct in dirs:
|
||||
if not isAccountDir(acct):
|
||||
if not is_account_dir(acct):
|
||||
continue
|
||||
accountDir = os.path.join(base_dir + '/accounts', acct)
|
||||
accessKeysFilename = accountDir + '/accessKeys.json'
|
||||
|
|
|
@ -9,7 +9,7 @@ __module_group__ = "Moderation"
|
|||
|
||||
import os
|
||||
from utils import is_artist
|
||||
from utils import isAccountDir
|
||||
from utils import is_account_dir
|
||||
from utils import get_full_domain
|
||||
from utils import is_editor
|
||||
from utils import load_json
|
||||
|
@ -300,7 +300,7 @@ def htmlModerationInfo(cssCache: {}, translate: {},
|
|||
accounts = []
|
||||
for subdir, dirs, files in os.walk(base_dir + '/accounts'):
|
||||
for acct in dirs:
|
||||
if not isAccountDir(acct):
|
||||
if not is_account_dir(acct):
|
||||
continue
|
||||
accounts.append(acct)
|
||||
break
|
||||
|
|
|
@ -12,7 +12,7 @@ from shutil import copyfile
|
|||
import urllib.parse
|
||||
from datetime import datetime
|
||||
from utils import get_base_content_from_post
|
||||
from utils import isAccountDir
|
||||
from utils import is_account_dir
|
||||
from utils import get_config_param
|
||||
from utils import get_full_domain
|
||||
from utils import is_editor
|
||||
|
@ -252,7 +252,7 @@ def htmlSearchSharedItems(cssCache: {}, translate: {},
|
|||
resultsExist = False
|
||||
for subdir, dirs, files in os.walk(base_dir + '/accounts'):
|
||||
for handle in dirs:
|
||||
if not isAccountDir(handle):
|
||||
if not is_account_dir(handle):
|
||||
continue
|
||||
contactNickname = handle.split('@')[0]
|
||||
sharesFilename = base_dir + '/accounts/' + handle + \
|
||||
|
@ -472,7 +472,7 @@ def htmlSkillsSearch(actor: str,
|
|||
for f in files:
|
||||
if not f.endswith('.json'):
|
||||
continue
|
||||
if not isAccountDir(f):
|
||||
if not is_account_dir(f):
|
||||
continue
|
||||
actorFilename = os.path.join(subdir, f)
|
||||
actor_json = load_json(actorFilename)
|
||||
|
@ -507,7 +507,7 @@ def htmlSkillsSearch(actor: str,
|
|||
for f in files:
|
||||
if not f.endswith('.json'):
|
||||
continue
|
||||
if not isAccountDir(f):
|
||||
if not is_account_dir(f):
|
||||
continue
|
||||
actorFilename = os.path.join(subdir, f)
|
||||
cachedActorJson = load_json(actorFilename)
|
||||
|
|
|
@ -11,7 +11,7 @@ import os
|
|||
from shutil import copyfile
|
||||
from collections import OrderedDict
|
||||
from session import getJson
|
||||
from utils import isAccountDir
|
||||
from utils import is_account_dir
|
||||
from utils import removeHtml
|
||||
from utils import getProtocolPrefixes
|
||||
from utils import load_json
|
||||
|
@ -356,7 +356,7 @@ def sharesTimelineJson(actor: str, pageNumber: int, itemsPerPage: int,
|
|||
allSharesJson = {}
|
||||
for subdir, dirs, files in os.walk(base_dir + '/accounts'):
|
||||
for handle in dirs:
|
||||
if not isAccountDir(handle):
|
||||
if not is_account_dir(handle):
|
||||
continue
|
||||
accountDir = base_dir + '/accounts/' + handle
|
||||
sharesFilename = accountDir + '/' + sharesFileType + '.json'
|
||||
|
|
Loading…
Reference in New Issue