forked from indymedia/epicyon
Backtracking
parent
1d7a019217
commit
454b4f3348
22
newswire.py
22
newswire.py
|
@ -239,24 +239,6 @@ def addAccountBlogsToNewswire(baseDir: str, nickname: str, domain: str,
|
|||
break
|
||||
|
||||
|
||||
def isTrustedByNewswire(baseDir: str, nickname: str) -> bool:
|
||||
"""Returns true if the given nickname is trusted to post
|
||||
blog entries to the newswire
|
||||
"""
|
||||
# adminNickname = getConfigParam(baseDir, 'admin')
|
||||
# if nickname == adminNickname:
|
||||
# return True
|
||||
|
||||
newswireTrustedFilename = baseDir + '/accounts/newswiretrusted.txt'
|
||||
if os.path.isfile(newswireTrustedFilename):
|
||||
with open(newswireTrustedFilename, "r") as f:
|
||||
lines = f.readlines()
|
||||
for trusted in lines:
|
||||
if trusted.strip('\n').strip('\r') == nickname:
|
||||
return True
|
||||
return False
|
||||
|
||||
|
||||
def addBlogsToNewswire(baseDir: str, newswire: {},
|
||||
maxBlogsPerAccount: int) -> None:
|
||||
"""Adds blogs from each user account into the newswire
|
||||
|
@ -277,10 +259,6 @@ def addBlogsToNewswire(baseDir: str, newswire: {},
|
|||
if isSuspended(baseDir, nickname):
|
||||
continue
|
||||
|
||||
# is this account trusted?
|
||||
if not isTrustedByNewswire(baseDir, nickname):
|
||||
continue
|
||||
|
||||
# is there a blogs timeline for this account?
|
||||
accountDir = os.path.join(baseDir + '/accounts', handle)
|
||||
blogsIndex = accountDir + '/tlblogs.index'
|
||||
|
|
Loading…
Reference in New Issue