mirror of https://gitlab.com/bashrc2/epicyon
Checking account directories
parent
2c09f48367
commit
d7ad3733ff
19
blog.py
19
blog.py
|
@ -16,6 +16,7 @@ from webapp_utils import htmlHeaderWithBlogMarkup
|
||||||
from webapp_utils import htmlFooter
|
from webapp_utils import htmlFooter
|
||||||
from webapp_utils import getPostAttachmentsAsHtml
|
from webapp_utils import getPostAttachmentsAsHtml
|
||||||
from webapp_media import addEmbeddedElements
|
from webapp_media import addEmbeddedElements
|
||||||
|
from utils import isAccountDir
|
||||||
from utils import removeHtml
|
from utils import removeHtml
|
||||||
from utils import getConfigParam
|
from utils import getConfigParam
|
||||||
from utils import getFullDomain
|
from utils import getFullDomain
|
||||||
|
@ -643,11 +644,7 @@ def _noOfBlogAccounts(baseDir: str) -> int:
|
||||||
ctr = 0
|
ctr = 0
|
||||||
for subdir, dirs, files in os.walk(baseDir + '/accounts'):
|
for subdir, dirs, files in os.walk(baseDir + '/accounts'):
|
||||||
for acct in dirs:
|
for acct in dirs:
|
||||||
if '@' not in acct:
|
if not isAccountDir(acct):
|
||||||
continue
|
|
||||||
if acct.startswith('inbox@'):
|
|
||||||
continue
|
|
||||||
elif acct.startswith('news@'):
|
|
||||||
continue
|
continue
|
||||||
accountDir = os.path.join(baseDir + '/accounts', acct)
|
accountDir = os.path.join(baseDir + '/accounts', acct)
|
||||||
blogsIndex = accountDir + '/tlblogs.index'
|
blogsIndex = accountDir + '/tlblogs.index'
|
||||||
|
@ -662,11 +659,7 @@ def _singleBlogAccountNickname(baseDir: str) -> str:
|
||||||
"""
|
"""
|
||||||
for subdir, dirs, files in os.walk(baseDir + '/accounts'):
|
for subdir, dirs, files in os.walk(baseDir + '/accounts'):
|
||||||
for acct in dirs:
|
for acct in dirs:
|
||||||
if '@' not in acct:
|
if not isAccountDir(acct):
|
||||||
continue
|
|
||||||
if acct.startswith('inbox@'):
|
|
||||||
continue
|
|
||||||
elif acct.startswith('news@'):
|
|
||||||
continue
|
continue
|
||||||
accountDir = os.path.join(baseDir + '/accounts', acct)
|
accountDir = os.path.join(baseDir + '/accounts', acct)
|
||||||
blogsIndex = accountDir + '/tlblogs.index'
|
blogsIndex = accountDir + '/tlblogs.index'
|
||||||
|
@ -704,11 +697,7 @@ def htmlBlogView(authorized: bool,
|
||||||
|
|
||||||
for subdir, dirs, files in os.walk(baseDir + '/accounts'):
|
for subdir, dirs, files in os.walk(baseDir + '/accounts'):
|
||||||
for acct in dirs:
|
for acct in dirs:
|
||||||
if '@' not in acct:
|
if not isAccountDir(acct):
|
||||||
continue
|
|
||||||
if acct.startswith('inbox@'):
|
|
||||||
continue
|
|
||||||
elif acct.startswith('news@'):
|
|
||||||
continue
|
continue
|
||||||
accountDir = os.path.join(baseDir + '/accounts', acct)
|
accountDir = os.path.join(baseDir + '/accounts', acct)
|
||||||
blogsIndex = accountDir + '/tlblogs.index'
|
blogsIndex = accountDir + '/tlblogs.index'
|
||||||
|
|
|
@ -8,6 +8,7 @@ __status__ = "Production"
|
||||||
__module_group__ = "Core"
|
__module_group__ = "Core"
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
from utils import isAccountDir
|
||||||
from utils import getNicknameFromActor
|
from utils import getNicknameFromActor
|
||||||
from utils import getDomainFromActor
|
from utils import getDomainFromActor
|
||||||
from webfinger import webfingerHandle
|
from webfinger import webfingerHandle
|
||||||
|
@ -186,11 +187,7 @@ def migrateAccounts(baseDir: str, session,
|
||||||
ctr = 0
|
ctr = 0
|
||||||
for subdir, dirs, files in os.walk(baseDir + '/accounts'):
|
for subdir, dirs, files in os.walk(baseDir + '/accounts'):
|
||||||
for handle in dirs:
|
for handle in dirs:
|
||||||
if '@' not in handle:
|
if not isAccountDir(handle):
|
||||||
continue
|
|
||||||
if handle.startswith('inbox@'):
|
|
||||||
continue
|
|
||||||
if handle.startswith('news@'):
|
|
||||||
continue
|
continue
|
||||||
nickname = handle.split('@')[0]
|
nickname = handle.split('@')[0]
|
||||||
domain = handle.split('@')[1]
|
domain = handle.split('@')[1]
|
||||||
|
|
7
theme.py
7
theme.py
|
@ -7,6 +7,7 @@ __email__ = "bob@freedombone.net"
|
||||||
__status__ = "Production"
|
__status__ = "Production"
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
from utils import isAccountDir
|
||||||
from utils import loadJson
|
from utils import loadJson
|
||||||
from utils import saveJson
|
from utils import saveJson
|
||||||
from utils import getImageExtensions
|
from utils import getImageExtensions
|
||||||
|
@ -623,11 +624,7 @@ def _setThemeImages(baseDir: str, name: str) -> None:
|
||||||
|
|
||||||
for subdir, dirs, files in os.walk(baseDir + '/accounts'):
|
for subdir, dirs, files in os.walk(baseDir + '/accounts'):
|
||||||
for acct in dirs:
|
for acct in dirs:
|
||||||
if '@' not in acct:
|
if not isAccountDir(acct):
|
||||||
continue
|
|
||||||
if acct.startswith('inbox@'):
|
|
||||||
continue
|
|
||||||
elif acct.startswith('news@'):
|
|
||||||
continue
|
continue
|
||||||
accountDir = \
|
accountDir = \
|
||||||
os.path.join(baseDir + '/accounts', acct)
|
os.path.join(baseDir + '/accounts', acct)
|
||||||
|
|
7
utils.py
7
utils.py
|
@ -5,7 +5,7 @@ __version__ = "1.2.0"
|
||||||
__maintainer__ = "Bob Mottram"
|
__maintainer__ = "Bob Mottram"
|
||||||
__email__ = "bob@freedombone.net"
|
__email__ = "bob@freedombone.net"
|
||||||
__status__ = "Production"
|
__status__ = "Production"
|
||||||
__module_group__ = "Core"
|
__module_group__ = "ActivityPu"
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
|
@ -1454,10 +1454,7 @@ def noOfActiveAccountsMonthly(baseDir: str, months: int) -> bool:
|
||||||
monthSeconds = int(60*60*24*30*months)
|
monthSeconds = int(60*60*24*30*months)
|
||||||
for subdir, dirs, files in os.walk(baseDir + '/accounts'):
|
for subdir, dirs, files in os.walk(baseDir + '/accounts'):
|
||||||
for account in dirs:
|
for account in dirs:
|
||||||
if '@' not in account:
|
if not isAccountDir(account):
|
||||||
continue
|
|
||||||
if account.startswith('inbox@') or \
|
|
||||||
account.startswith('news@'):
|
|
||||||
continue
|
continue
|
||||||
lastUsedFilename = \
|
lastUsedFilename = \
|
||||||
baseDir + '/accounts/' + account + '/.lastUsed'
|
baseDir + '/accounts/' + account + '/.lastUsed'
|
||||||
|
|
|
@ -8,6 +8,7 @@ __status__ = "Production"
|
||||||
__module_group__ = "Web Interface"
|
__module_group__ = "Web Interface"
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
from utils import isAccountDir
|
||||||
from utils import getFullDomain
|
from utils import getFullDomain
|
||||||
from utils import isEditor
|
from utils import isEditor
|
||||||
from utils import loadJson
|
from utils import loadJson
|
||||||
|
@ -270,11 +271,7 @@ def htmlModerationInfo(cssCache: {}, translate: {},
|
||||||
accounts = []
|
accounts = []
|
||||||
for subdir, dirs, files in os.walk(baseDir + '/accounts'):
|
for subdir, dirs, files in os.walk(baseDir + '/accounts'):
|
||||||
for acct in dirs:
|
for acct in dirs:
|
||||||
if '@' not in acct:
|
if not isAccountDir(acct):
|
||||||
continue
|
|
||||||
if acct.startswith('inbox@'):
|
|
||||||
continue
|
|
||||||
elif acct.startswith('news@'):
|
|
||||||
continue
|
continue
|
||||||
accounts.append(acct)
|
accounts.append(acct)
|
||||||
break
|
break
|
||||||
|
|
|
@ -11,6 +11,7 @@ import os
|
||||||
from shutil import copyfile
|
from shutil import copyfile
|
||||||
import urllib.parse
|
import urllib.parse
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
|
from utils import isAccountDir
|
||||||
from utils import getConfigParam
|
from utils import getConfigParam
|
||||||
from utils import getFullDomain
|
from utils import getFullDomain
|
||||||
from utils import isEditor
|
from utils import isEditor
|
||||||
|
@ -407,11 +408,7 @@ def htmlSkillsSearch(actor: str,
|
||||||
for f in files:
|
for f in files:
|
||||||
if not f.endswith('.json'):
|
if not f.endswith('.json'):
|
||||||
continue
|
continue
|
||||||
if '@' not in f:
|
if not isAccountDir(f):
|
||||||
continue
|
|
||||||
if f.startswith('inbox@'):
|
|
||||||
continue
|
|
||||||
elif f.startswith('news@'):
|
|
||||||
continue
|
continue
|
||||||
actorFilename = os.path.join(subdir, f)
|
actorFilename = os.path.join(subdir, f)
|
||||||
actorJson = loadJson(actorFilename)
|
actorJson = loadJson(actorFilename)
|
||||||
|
@ -446,11 +443,7 @@ def htmlSkillsSearch(actor: str,
|
||||||
for f in files:
|
for f in files:
|
||||||
if not f.endswith('.json'):
|
if not f.endswith('.json'):
|
||||||
continue
|
continue
|
||||||
if '@' not in f:
|
if not isAccountDir(f):
|
||||||
continue
|
|
||||||
if f.startswith('inbox@'):
|
|
||||||
continue
|
|
||||||
elif f.startswith('news@'):
|
|
||||||
continue
|
continue
|
||||||
actorFilename = os.path.join(subdir, f)
|
actorFilename = os.path.join(subdir, f)
|
||||||
cachedActorJson = loadJson(actorFilename)
|
cachedActorJson = loadJson(actorFilename)
|
||||||
|
|
Loading…
Reference in New Issue