Include news account

merge-requests/30/head
Bob Mottram 2021-04-21 17:09:56 +01:00
parent 10492581ff
commit 35205a9309
5 changed files with 30 additions and 10 deletions

12
blog.py
View File

@ -619,7 +619,9 @@ def _noOfBlogAccounts(baseDir: str) -> int:
for acct in dirs:
if '@' not in acct:
continue
if 'inbox@' in acct:
if acct.startswith('inbox@'):
continue
elif acct.startswith('news@'):
continue
accountDir = os.path.join(baseDir + '/accounts', acct)
blogsIndex = accountDir + '/tlblogs.index'
@ -636,7 +638,9 @@ def _singleBlogAccountNickname(baseDir: str) -> str:
for acct in dirs:
if '@' not in acct:
continue
if 'inbox@' in acct:
if acct.startswith('inbox@'):
continue
elif acct.startswith('news@'):
continue
accountDir = os.path.join(baseDir + '/accounts', acct)
blogsIndex = accountDir + '/tlblogs.index'
@ -676,7 +680,9 @@ def htmlBlogView(authorized: bool,
for acct in dirs:
if '@' not in acct:
continue
if 'inbox@' in acct:
if acct.startswith('inbox@'):
continue
elif acct.startswith('news@'):
continue
accountDir = os.path.join(baseDir + '/accounts', acct)
blogsIndex = accountDir + '/tlblogs.index'

View File

@ -551,7 +551,9 @@ def _setThemeImages(baseDir: str, name: str) -> None:
for acct in dirs:
if '@' not in acct:
continue
if 'inbox@' in acct:
if acct.startswith('inbox@'):
continue
elif acct.startswith('news@'):
continue
accountDir = \
os.path.join(baseDir + '/accounts', acct)

View File

@ -388,7 +388,9 @@ def getFollowersOfPerson(baseDir: str,
for subdir, dirs, files in os.walk(baseDir + '/accounts'):
for account in dirs:
filename = os.path.join(subdir, account) + '/' + followFile
if account == handle or account.startswith('inbox@'):
if account == handle or \
account.startswith('inbox@') or \
account.startswith('news@'):
continue
if not os.path.isfile(filename):
continue
@ -1057,7 +1059,7 @@ def clearFromPostCaches(baseDir: str, recentPostsCache: {},
for acct in dirs:
if '@' not in acct:
continue
if 'inbox@' in acct:
if acct.startswith('inbox@'):
continue
cacheDir = os.path.join(baseDir + '/accounts', acct)
postFilename = cacheDir + filename
@ -1405,8 +1407,11 @@ def noOfAccounts(baseDir: str) -> bool:
for subdir, dirs, files in os.walk(baseDir + '/accounts'):
for account in dirs:
if '@' in account:
if not account.startswith('inbox@'):
accountCtr += 1
if account.startswith('inbox@'):
continue
elif account.startswith('news@'):
continue
accountCtr += 1
break
return accountCtr
@ -1420,7 +1425,8 @@ def noOfActiveAccountsMonthly(baseDir: str, months: int) -> bool:
for subdir, dirs, files in os.walk(baseDir + '/accounts'):
for account in dirs:
if '@' in account:
if not account.startswith('inbox@'):
if not account.startswith('inbox@') and \
not account.startswith('news@'):
lastUsedFilename = \
baseDir + '/accounts/' + account + '/.lastUsed'
if os.path.isfile(lastUsedFilename):

View File

@ -270,7 +270,9 @@ def htmlModerationInfo(cssCache: {}, translate: {},
for acct in dirs:
if '@' not in acct:
continue
if 'inbox@' in acct or 'news@' in acct:
if acct.startswith('inbox@'):
continue
elif acct.startswith('news@'):
continue
accounts.append(acct)
break

View File

@ -404,6 +404,8 @@ def htmlSkillsSearch(actor: str,
continue
if f.startswith('inbox@'):
continue
elif f.startswith('news@'):
continue
actorFilename = os.path.join(subdir, f)
actorJson = loadJson(actorFilename)
if actorJson:
@ -439,6 +441,8 @@ def htmlSkillsSearch(actor: str,
continue
if f.startswith('inbox@'):
continue
elif f.startswith('news@'):
continue
actorFilename = os.path.join(subdir, f)
cachedActorJson = loadJson(actorFilename)
if cachedActorJson: