mirror of https://gitlab.com/bashrc2/epicyon
File open attribute style
parent
d502cd89f9
commit
5e2b02ad81
6
auth.py
6
auth.py
|
|
@ -132,7 +132,7 @@ def authorizeBasic(baseDir: str, path: str, authHeader: str,
|
||||||
print('DEBUG: passwords file missing')
|
print('DEBUG: passwords file missing')
|
||||||
return False
|
return False
|
||||||
providedPassword = plain.split(':')[1]
|
providedPassword = plain.split(':')[1]
|
||||||
passfile = open(passwordFile, "r")
|
passfile = open(passwordFile, 'r')
|
||||||
for line in passfile:
|
for line in passfile:
|
||||||
if line.startswith(nickname + ':'):
|
if line.startswith(nickname + ':'):
|
||||||
storedPassword = \
|
storedPassword = \
|
||||||
|
|
@ -162,7 +162,7 @@ def storeBasicCredentials(baseDir: str, nickname: str, password: str) -> bool:
|
||||||
storeStr = nickname + ':' + _hashPassword(password)
|
storeStr = nickname + ':' + _hashPassword(password)
|
||||||
if os.path.isfile(passwordFile):
|
if os.path.isfile(passwordFile):
|
||||||
if nickname + ':' in open(passwordFile).read():
|
if nickname + ':' in open(passwordFile).read():
|
||||||
with open(passwordFile, "r") as fin:
|
with open(passwordFile, 'r') as fin:
|
||||||
with open(passwordFile + '.new', 'w+') as fout:
|
with open(passwordFile + '.new', 'w+') as fout:
|
||||||
for line in fin:
|
for line in fin:
|
||||||
if not line.startswith(nickname + ':'):
|
if not line.startswith(nickname + ':'):
|
||||||
|
|
@ -186,7 +186,7 @@ def removePassword(baseDir: str, nickname: str) -> None:
|
||||||
"""
|
"""
|
||||||
passwordFile = baseDir + '/accounts/passwords'
|
passwordFile = baseDir + '/accounts/passwords'
|
||||||
if os.path.isfile(passwordFile):
|
if os.path.isfile(passwordFile):
|
||||||
with open(passwordFile, "r") as fin:
|
with open(passwordFile, 'r') as fin:
|
||||||
with open(passwordFile + '.new', 'w+') as fout:
|
with open(passwordFile + '.new', 'w+') as fout:
|
||||||
for line in fin:
|
for line in fin:
|
||||||
if not line.startswith(nickname + ':'):
|
if not line.startswith(nickname + ':'):
|
||||||
|
|
|
||||||
|
|
@ -720,7 +720,7 @@ def setBrochMode(baseDir: str, domainFull: str, enabled: bool) -> None:
|
||||||
followingFilename = accountDir + '/' + followFileType
|
followingFilename = accountDir + '/' + followFileType
|
||||||
if not os.path.isfile(followingFilename):
|
if not os.path.isfile(followingFilename):
|
||||||
continue
|
continue
|
||||||
with open(followingFilename, "r") as f:
|
with open(followingFilename, 'r') as f:
|
||||||
followList = f.readlines()
|
followList = f.readlines()
|
||||||
for handle in followList:
|
for handle in followList:
|
||||||
if '@' not in handle:
|
if '@' not in handle:
|
||||||
|
|
|
||||||
8
blog.py
8
blog.py
|
|
@ -65,7 +65,7 @@ def _noOfBlogReplies(baseDir: str, httpPrefix: str, translate: {},
|
||||||
removals = []
|
removals = []
|
||||||
replies = 0
|
replies = 0
|
||||||
lines = []
|
lines = []
|
||||||
with open(postFilename, "r") as f:
|
with open(postFilename, 'r') as f:
|
||||||
lines = f.readlines()
|
lines = f.readlines()
|
||||||
for replyPostId in lines:
|
for replyPostId in lines:
|
||||||
replyPostId = replyPostId.replace('\n', '').replace('\r', '')
|
replyPostId = replyPostId.replace('\n', '').replace('\r', '')
|
||||||
|
|
@ -124,11 +124,11 @@ def _getBlogReplies(baseDir: str, httpPrefix: str, translate: {},
|
||||||
'/postcache/' + \
|
'/postcache/' + \
|
||||||
postId.replace('/', '#') + '.html'
|
postId.replace('/', '#') + '.html'
|
||||||
if os.path.isfile(postFilename):
|
if os.path.isfile(postFilename):
|
||||||
with open(postFilename, "r") as postFile:
|
with open(postFilename, 'r') as postFile:
|
||||||
return postFile.read() + '\n'
|
return postFile.read() + '\n'
|
||||||
return ''
|
return ''
|
||||||
|
|
||||||
with open(postFilename, "r") as f:
|
with open(postFilename, 'r') as f:
|
||||||
lines = f.readlines()
|
lines = f.readlines()
|
||||||
repliesStr = ''
|
repliesStr = ''
|
||||||
for replyPostId in lines:
|
for replyPostId in lines:
|
||||||
|
|
@ -141,7 +141,7 @@ def _getBlogReplies(baseDir: str, httpPrefix: str, translate: {},
|
||||||
replyPostId.replace('/', '#') + '.html'
|
replyPostId.replace('/', '#') + '.html'
|
||||||
if not os.path.isfile(postFilename):
|
if not os.path.isfile(postFilename):
|
||||||
continue
|
continue
|
||||||
with open(postFilename, "r") as postFile:
|
with open(postFilename, 'r') as postFile:
|
||||||
repliesStr += postFile.read() + '\n'
|
repliesStr += postFile.read() + '\n'
|
||||||
rply = _getBlogReplies(baseDir, httpPrefix, translate,
|
rply = _getBlogReplies(baseDir, httpPrefix, translate,
|
||||||
nickname, domain, domainFull,
|
nickname, domain, domainFull,
|
||||||
|
|
|
||||||
4
city.py
4
city.py
|
|
@ -195,7 +195,7 @@ def spoofGeolocation(baseDir: str,
|
||||||
default_latdirection, default_longdirection,
|
default_latdirection, default_longdirection,
|
||||||
"", "", 0)
|
"", "", 0)
|
||||||
cities = []
|
cities = []
|
||||||
with open(locationsFilename, "r") as f:
|
with open(locationsFilename, 'r') as f:
|
||||||
cities = f.readlines()
|
cities = f.readlines()
|
||||||
|
|
||||||
nogo = []
|
nogo = []
|
||||||
|
|
@ -203,7 +203,7 @@ def spoofGeolocation(baseDir: str,
|
||||||
nogo = nogoList
|
nogo = nogoList
|
||||||
else:
|
else:
|
||||||
if os.path.isfile(nogoFilename):
|
if os.path.isfile(nogoFilename):
|
||||||
with open(nogoFilename, "r") as f:
|
with open(nogoFilename, 'r') as f:
|
||||||
nogoList = f.readlines()
|
nogoList = f.readlines()
|
||||||
for line in nogoList:
|
for line in nogoList:
|
||||||
if line.startswith(city + ':'):
|
if line.startswith(city + ':'):
|
||||||
|
|
|
||||||
|
|
@ -709,7 +709,7 @@ def _loadAutoTags(baseDir: str, nickname: str, domain: str) -> []:
|
||||||
nickname + '@' + domain + '/autotags.txt'
|
nickname + '@' + domain + '/autotags.txt'
|
||||||
if not os.path.isfile(filename):
|
if not os.path.isfile(filename):
|
||||||
return []
|
return []
|
||||||
with open(filename, "r") as f:
|
with open(filename, 'r') as f:
|
||||||
return f.readlines()
|
return f.readlines()
|
||||||
return []
|
return []
|
||||||
|
|
||||||
|
|
@ -784,7 +784,7 @@ def addHtmlTags(baseDir: str, httpPrefix: str,
|
||||||
petnames = None
|
petnames = None
|
||||||
if '@' in words:
|
if '@' in words:
|
||||||
if os.path.isfile(followingFilename):
|
if os.path.isfile(followingFilename):
|
||||||
with open(followingFilename, "r") as f:
|
with open(followingFilename, 'r') as f:
|
||||||
following = f.readlines()
|
following = f.readlines()
|
||||||
for handle in following:
|
for handle in following:
|
||||||
pet = getPetName(baseDir, nickname, domain, handle)
|
pet = getPetName(baseDir, nickname, domain, handle)
|
||||||
|
|
|
||||||
14
follow.py
14
follow.py
|
|
@ -257,7 +257,7 @@ def unfollowAccount(baseDir: str, nickname: str, domain: str,
|
||||||
print('DEBUG: handle to unfollow ' + handleToUnfollow +
|
print('DEBUG: handle to unfollow ' + handleToUnfollow +
|
||||||
' is not in ' + filename)
|
' is not in ' + filename)
|
||||||
return
|
return
|
||||||
with open(filename, "r") as f:
|
with open(filename, 'r') as f:
|
||||||
lines = f.readlines()
|
lines = f.readlines()
|
||||||
with open(filename, 'w+') as f:
|
with open(filename, 'w+') as f:
|
||||||
for line in lines:
|
for line in lines:
|
||||||
|
|
@ -271,10 +271,10 @@ def unfollowAccount(baseDir: str, nickname: str, domain: str,
|
||||||
if os.path.isfile(unfollowedFilename):
|
if os.path.isfile(unfollowedFilename):
|
||||||
if handleToUnfollowLower not in \
|
if handleToUnfollowLower not in \
|
||||||
open(unfollowedFilename).read().lower():
|
open(unfollowedFilename).read().lower():
|
||||||
with open(unfollowedFilename, "a+") as f:
|
with open(unfollowedFilename, 'a+') as f:
|
||||||
f.write(handleToUnfollow + '\n')
|
f.write(handleToUnfollow + '\n')
|
||||||
else:
|
else:
|
||||||
with open(unfollowedFilename, "w+") as f:
|
with open(unfollowedFilename, 'w+') as f:
|
||||||
f.write(handleToUnfollow + '\n')
|
f.write(handleToUnfollow + '\n')
|
||||||
|
|
||||||
return True
|
return True
|
||||||
|
|
@ -324,7 +324,7 @@ def _getNoOfFollows(baseDir: str, nickname: str, domain: str,
|
||||||
if not os.path.isfile(filename):
|
if not os.path.isfile(filename):
|
||||||
return 0
|
return 0
|
||||||
ctr = 0
|
ctr = 0
|
||||||
with open(filename, "r") as f:
|
with open(filename, 'r') as f:
|
||||||
lines = f.readlines()
|
lines = f.readlines()
|
||||||
for line in lines:
|
for line in lines:
|
||||||
if '#' in line:
|
if '#' in line:
|
||||||
|
|
@ -435,7 +435,7 @@ def getFollowingFeed(baseDir: str, domain: str, port: int, path: str,
|
||||||
currPage = 1
|
currPage = 1
|
||||||
pageCtr = 0
|
pageCtr = 0
|
||||||
totalCtr = 0
|
totalCtr = 0
|
||||||
with open(filename, "r") as f:
|
with open(filename, 'r') as f:
|
||||||
lines = f.readlines()
|
lines = f.readlines()
|
||||||
for line in lines:
|
for line in lines:
|
||||||
if '#' not in line:
|
if '#' not in line:
|
||||||
|
|
@ -516,7 +516,7 @@ def _noOfFollowRequests(baseDir: str,
|
||||||
if not os.path.isfile(approveFollowsFilename):
|
if not os.path.isfile(approveFollowsFilename):
|
||||||
return 0
|
return 0
|
||||||
ctr = 0
|
ctr = 0
|
||||||
with open(approveFollowsFilename, "r") as f:
|
with open(approveFollowsFilename, 'r') as f:
|
||||||
lines = f.readlines()
|
lines = f.readlines()
|
||||||
if followType == "onion":
|
if followType == "onion":
|
||||||
for fileLine in lines:
|
for fileLine in lines:
|
||||||
|
|
@ -600,7 +600,7 @@ def _storeFollowRequest(baseDir: str,
|
||||||
print('DEBUG: ' + approveHandleStored +
|
print('DEBUG: ' + approveHandleStored +
|
||||||
' is already awaiting approval')
|
' is already awaiting approval')
|
||||||
else:
|
else:
|
||||||
with open(approveFollowsFilename, "w+") as fp:
|
with open(approveFollowsFilename, 'w+') as fp:
|
||||||
fp.write(approveHandleStored + '\n')
|
fp.write(approveHandleStored + '\n')
|
||||||
|
|
||||||
# store the follow request in its own directory
|
# store the follow request in its own directory
|
||||||
|
|
|
||||||
|
|
@ -441,11 +441,11 @@ def removeCalendarEvent(baseDir: str, nickname: str, domain: str,
|
||||||
if messageId not in open(calendarFilename).read():
|
if messageId not in open(calendarFilename).read():
|
||||||
return
|
return
|
||||||
lines = None
|
lines = None
|
||||||
with open(calendarFilename, "r") as f:
|
with open(calendarFilename, 'r') as f:
|
||||||
lines = f.readlines()
|
lines = f.readlines()
|
||||||
if not lines:
|
if not lines:
|
||||||
return
|
return
|
||||||
with open(calendarFilename, "w+") as f:
|
with open(calendarFilename, 'w+') as f:
|
||||||
for line in lines:
|
for line in lines:
|
||||||
if messageId not in line:
|
if messageId not in line:
|
||||||
f.write(line)
|
f.write(line)
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@ def _moveFollowingHandlesForAccount(baseDir: str, nickname: str, domain: str,
|
||||||
baseDir + '/accounts/' + nickname + '@' + domain + '/following.txt'
|
baseDir + '/accounts/' + nickname + '@' + domain + '/following.txt'
|
||||||
if not os.path.isfile(followingFilename):
|
if not os.path.isfile(followingFilename):
|
||||||
return ctr
|
return ctr
|
||||||
with open(followingFilename, "r") as f:
|
with open(followingFilename, 'r') as f:
|
||||||
followingHandles = f.readlines()
|
followingHandles = f.readlines()
|
||||||
for followHandle in followingHandles:
|
for followHandle in followingHandles:
|
||||||
followHandle = followHandle.strip("\n").strip("\r")
|
followHandle = followHandle.strip("\n").strip("\r")
|
||||||
|
|
@ -114,7 +114,7 @@ def _updateMovedHandle(baseDir: str, nickname: str, domain: str,
|
||||||
followingFilename = \
|
followingFilename = \
|
||||||
baseDir + '/accounts/' + nickname + '@' + domain + '/following.txt'
|
baseDir + '/accounts/' + nickname + '@' + domain + '/following.txt'
|
||||||
if os.path.isfile(followingFilename):
|
if os.path.isfile(followingFilename):
|
||||||
with open(followingFilename, "r") as f:
|
with open(followingFilename, 'r') as f:
|
||||||
followingHandles = f.readlines()
|
followingHandles = f.readlines()
|
||||||
|
|
||||||
movedToHandle = movedToNickname + '@' + movedToDomainFull
|
movedToHandle = movedToNickname + '@' + movedToDomainFull
|
||||||
|
|
@ -152,7 +152,7 @@ def _updateMovedHandle(baseDir: str, nickname: str, domain: str,
|
||||||
followersFilename = \
|
followersFilename = \
|
||||||
baseDir + '/accounts/' + nickname + '@' + domain + '/followers.txt'
|
baseDir + '/accounts/' + nickname + '@' + domain + '/followers.txt'
|
||||||
if os.path.isfile(followersFilename):
|
if os.path.isfile(followersFilename):
|
||||||
with open(followersFilename, "r") as f:
|
with open(followersFilename, 'r') as f:
|
||||||
followerHandles = f.readlines()
|
followerHandles = f.readlines()
|
||||||
|
|
||||||
handleLower = handle.lower()
|
handleLower = handle.lower()
|
||||||
|
|
|
||||||
|
|
@ -374,7 +374,7 @@ def _newswireHashtagProcessing(session, baseDir: str, postJsonObject: {},
|
||||||
if not os.path.isfile(rulesFilename):
|
if not os.path.isfile(rulesFilename):
|
||||||
return True
|
return True
|
||||||
rules = []
|
rules = []
|
||||||
with open(rulesFilename, "r") as f:
|
with open(rulesFilename, 'r') as f:
|
||||||
rules = f.readlines()
|
rules = f.readlines()
|
||||||
|
|
||||||
domainFull = getFullDomain(domain, port)
|
domainFull = getFullDomain(domain, port)
|
||||||
|
|
@ -471,7 +471,7 @@ def _createNewsMirror(baseDir: str, domain: str,
|
||||||
for removePostId in removals:
|
for removePostId in removals:
|
||||||
indexContent = \
|
indexContent = \
|
||||||
indexContent.replace(removePostId + '\n', '')
|
indexContent.replace(removePostId + '\n', '')
|
||||||
with open(mirrorIndexFilename, "w+") as indexFile:
|
with open(mirrorIndexFilename, 'w+') as indexFile:
|
||||||
indexFile.write(indexContent)
|
indexFile.write(indexContent)
|
||||||
|
|
||||||
mirrorArticleDir = mirrorDir + '/' + postIdNumber
|
mirrorArticleDir = mirrorDir + '/' + postIdNumber
|
||||||
|
|
|
||||||
12
person.py
12
person.py
|
|
@ -872,7 +872,7 @@ def reenableAccount(baseDir: str, nickname: str) -> None:
|
||||||
suspendedFilename = baseDir + '/accounts/suspended.txt'
|
suspendedFilename = baseDir + '/accounts/suspended.txt'
|
||||||
if os.path.isfile(suspendedFilename):
|
if os.path.isfile(suspendedFilename):
|
||||||
lines = []
|
lines = []
|
||||||
with open(suspendedFilename, "r") as f:
|
with open(suspendedFilename, 'r') as f:
|
||||||
lines = f.readlines()
|
lines = f.readlines()
|
||||||
with open(suspendedFilename, 'w+') as suspendedFile:
|
with open(suspendedFilename, 'w+') as suspendedFile:
|
||||||
for suspended in lines:
|
for suspended in lines:
|
||||||
|
|
@ -893,7 +893,7 @@ def suspendAccount(baseDir: str, nickname: str, domain: str) -> None:
|
||||||
# Don't suspend moderators
|
# Don't suspend moderators
|
||||||
moderatorsFile = baseDir + '/accounts/moderators.txt'
|
moderatorsFile = baseDir + '/accounts/moderators.txt'
|
||||||
if os.path.isfile(moderatorsFile):
|
if os.path.isfile(moderatorsFile):
|
||||||
with open(moderatorsFile, "r") as f:
|
with open(moderatorsFile, 'r') as f:
|
||||||
lines = f.readlines()
|
lines = f.readlines()
|
||||||
for moderator in lines:
|
for moderator in lines:
|
||||||
if moderator.strip('\n').strip('\r') == nickname:
|
if moderator.strip('\n').strip('\r') == nickname:
|
||||||
|
|
@ -910,7 +910,7 @@ def suspendAccount(baseDir: str, nickname: str, domain: str) -> None:
|
||||||
|
|
||||||
suspendedFilename = baseDir + '/accounts/suspended.txt'
|
suspendedFilename = baseDir + '/accounts/suspended.txt'
|
||||||
if os.path.isfile(suspendedFilename):
|
if os.path.isfile(suspendedFilename):
|
||||||
with open(suspendedFilename, "r") as f:
|
with open(suspendedFilename, 'r') as f:
|
||||||
lines = f.readlines()
|
lines = f.readlines()
|
||||||
for suspended in lines:
|
for suspended in lines:
|
||||||
if suspended.strip('\n').strip('\r') == nickname:
|
if suspended.strip('\n').strip('\r') == nickname:
|
||||||
|
|
@ -941,7 +941,7 @@ def canRemovePost(baseDir: str, nickname: str,
|
||||||
# is the post by a moderator?
|
# is the post by a moderator?
|
||||||
moderatorsFile = baseDir + '/accounts/moderators.txt'
|
moderatorsFile = baseDir + '/accounts/moderators.txt'
|
||||||
if os.path.isfile(moderatorsFile):
|
if os.path.isfile(moderatorsFile):
|
||||||
with open(moderatorsFile, "r") as f:
|
with open(moderatorsFile, 'r') as f:
|
||||||
lines = f.readlines()
|
lines = f.readlines()
|
||||||
for moderator in lines:
|
for moderator in lines:
|
||||||
if domainFull + '/users/' + moderator.strip('\n') + '/' in postId:
|
if domainFull + '/users/' + moderator.strip('\n') + '/' in postId:
|
||||||
|
|
@ -972,7 +972,7 @@ def _removeTagsForNickname(baseDir: str, nickname: str,
|
||||||
if matchStr not in open(tagFilename).read():
|
if matchStr not in open(tagFilename).read():
|
||||||
continue
|
continue
|
||||||
lines = []
|
lines = []
|
||||||
with open(tagFilename, "r") as f:
|
with open(tagFilename, 'r') as f:
|
||||||
lines = f.readlines()
|
lines = f.readlines()
|
||||||
with open(tagFilename, 'w+') as tagFile:
|
with open(tagFilename, 'w+') as tagFile:
|
||||||
for tagline in lines:
|
for tagline in lines:
|
||||||
|
|
@ -994,7 +994,7 @@ def removeAccount(baseDir: str, nickname: str,
|
||||||
# Don't remove moderators
|
# Don't remove moderators
|
||||||
moderatorsFile = baseDir + '/accounts/moderators.txt'
|
moderatorsFile = baseDir + '/accounts/moderators.txt'
|
||||||
if os.path.isfile(moderatorsFile):
|
if os.path.isfile(moderatorsFile):
|
||||||
with open(moderatorsFile, "r") as f:
|
with open(moderatorsFile, 'r') as f:
|
||||||
lines = f.readlines()
|
lines = f.readlines()
|
||||||
for moderator in lines:
|
for moderator in lines:
|
||||||
if moderator.strip('\n') == nickname:
|
if moderator.strip('\n') == nickname:
|
||||||
|
|
|
||||||
20
posts.py
20
posts.py
|
|
@ -89,7 +89,7 @@ def isModerator(baseDir: str, nickname: str) -> bool:
|
||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
|
||||||
with open(moderatorsFile, "r") as f:
|
with open(moderatorsFile, 'r') as f:
|
||||||
lines = f.readlines()
|
lines = f.readlines()
|
||||||
if len(lines) == 0:
|
if len(lines) == 0:
|
||||||
adminName = getConfigParam(baseDir, 'admin')
|
adminName = getConfigParam(baseDir, 'admin')
|
||||||
|
|
@ -113,7 +113,7 @@ def noOfFollowersOnDomain(baseDir: str, handle: str,
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
ctr = 0
|
ctr = 0
|
||||||
with open(filename, "r") as followersFilename:
|
with open(filename, 'r') as followersFilename:
|
||||||
for followerHandle in followersFilename:
|
for followerHandle in followersFilename:
|
||||||
if '@' in followerHandle:
|
if '@' in followerHandle:
|
||||||
followerDomain = followerHandle.split('@')[1]
|
followerDomain = followerHandle.split('@')[1]
|
||||||
|
|
@ -135,7 +135,7 @@ def _getPersonKey(nickname: str, domain: str, baseDir: str,
|
||||||
print('DEBUG: private key file not found: ' + keyFilename)
|
print('DEBUG: private key file not found: ' + keyFilename)
|
||||||
return ''
|
return ''
|
||||||
keyPem = ''
|
keyPem = ''
|
||||||
with open(keyFilename, "r") as pemFile:
|
with open(keyFilename, 'r') as pemFile:
|
||||||
keyPem = pemFile.read()
|
keyPem = pemFile.read()
|
||||||
if len(keyPem) < 20:
|
if len(keyPem) < 20:
|
||||||
if debug:
|
if debug:
|
||||||
|
|
@ -779,7 +779,7 @@ def _loadAutoCW(baseDir: str, nickname: str, domain: str) -> []:
|
||||||
nickname + '@' + domain + '/autocw.txt'
|
nickname + '@' + domain + '/autocw.txt'
|
||||||
if not os.path.isfile(filename):
|
if not os.path.isfile(filename):
|
||||||
return []
|
return []
|
||||||
with open(filename, "r") as f:
|
with open(filename, 'r') as f:
|
||||||
return f.readlines()
|
return f.readlines()
|
||||||
return []
|
return []
|
||||||
|
|
||||||
|
|
@ -1350,7 +1350,7 @@ def getPinnedPostAsJson(baseDir: str, httpPrefix: str,
|
||||||
actor = httpPrefix + '://' + domainFull + '/users/' + nickname
|
actor = httpPrefix + '://' + domainFull + '/users/' + nickname
|
||||||
if os.path.isfile(pinnedFilename):
|
if os.path.isfile(pinnedFilename):
|
||||||
pinnedContent = None
|
pinnedContent = None
|
||||||
with open(pinnedFilename, "r") as pinFile:
|
with open(pinnedFilename, 'r') as pinFile:
|
||||||
pinnedContent = pinFile.read()
|
pinnedContent = pinFile.read()
|
||||||
if pinnedContent:
|
if pinnedContent:
|
||||||
pinnedPostJson = {
|
pinnedPostJson = {
|
||||||
|
|
@ -1469,7 +1469,7 @@ def _appendCitationsToBlogPost(baseDir: str,
|
||||||
if not os.path.isfile(citationsFilename):
|
if not os.path.isfile(citationsFilename):
|
||||||
return
|
return
|
||||||
citationsSeparator = '#####'
|
citationsSeparator = '#####'
|
||||||
with open(citationsFilename, "r") as f:
|
with open(citationsFilename, 'r') as f:
|
||||||
citations = f.readlines()
|
citations = f.readlines()
|
||||||
for line in citations:
|
for line in citations:
|
||||||
if citationsSeparator not in line:
|
if citationsSeparator not in line:
|
||||||
|
|
@ -1753,7 +1753,7 @@ def createReportPost(baseDir: str,
|
||||||
moderatorsList = []
|
moderatorsList = []
|
||||||
moderatorsFile = baseDir + '/accounts/moderators.txt'
|
moderatorsFile = baseDir + '/accounts/moderators.txt'
|
||||||
if os.path.isfile(moderatorsFile):
|
if os.path.isfile(moderatorsFile):
|
||||||
with open(moderatorsFile, "r") as fileHandler:
|
with open(moderatorsFile, 'r') as fileHandler:
|
||||||
for line in fileHandler:
|
for line in fileHandler:
|
||||||
line = line.strip('\n').strip('\r')
|
line = line.strip('\n').strip('\r')
|
||||||
if line.startswith('#'):
|
if line.startswith('#'):
|
||||||
|
|
@ -1865,7 +1865,7 @@ def threadSendPost(session, postJsonStr: str, federationList: [],
|
||||||
if debug:
|
if debug:
|
||||||
# save the log file
|
# save the log file
|
||||||
postLogFilename = baseDir + '/post.log'
|
postLogFilename = baseDir + '/post.log'
|
||||||
with open(postLogFilename, "a+") as logFile:
|
with open(postLogFilename, 'a+') as logFile:
|
||||||
logFile.write(logStr + '\n')
|
logFile.write(logStr + '\n')
|
||||||
|
|
||||||
if postResult:
|
if postResult:
|
||||||
|
|
@ -2138,7 +2138,7 @@ def groupFollowersByDomain(baseDir: str, nickname: str, domain: str) -> {}:
|
||||||
if not os.path.isfile(followersFilename):
|
if not os.path.isfile(followersFilename):
|
||||||
return None
|
return None
|
||||||
grouped = {}
|
grouped = {}
|
||||||
with open(followersFilename, "r") as f:
|
with open(followersFilename, 'r') as f:
|
||||||
for followerHandle in f:
|
for followerHandle in f:
|
||||||
if '@' not in followerHandle:
|
if '@' not in followerHandle:
|
||||||
continue
|
continue
|
||||||
|
|
@ -2889,7 +2889,7 @@ def createModeration(baseDir: str, nickname: str, domain: str, port: int,
|
||||||
if isModerator(baseDir, nickname):
|
if isModerator(baseDir, nickname):
|
||||||
moderationIndexFile = baseDir + '/accounts/moderation.txt'
|
moderationIndexFile = baseDir + '/accounts/moderation.txt'
|
||||||
if os.path.isfile(moderationIndexFile):
|
if os.path.isfile(moderationIndexFile):
|
||||||
with open(moderationIndexFile, "r") as f:
|
with open(moderationIndexFile, 'r') as f:
|
||||||
lines = f.readlines()
|
lines = f.readlines()
|
||||||
boxHeader['totalItems'] = len(lines)
|
boxHeader['totalItems'] = len(lines)
|
||||||
if headerOnly:
|
if headerOnly:
|
||||||
|
|
|
||||||
|
|
@ -77,7 +77,7 @@ def questionUpdateVotes(baseDir: str, nickname: str, domain: str,
|
||||||
foundAnswer + '\n')
|
foundAnswer + '\n')
|
||||||
else:
|
else:
|
||||||
# change an entry in the voters file
|
# change an entry in the voters file
|
||||||
with open(votersFilename, "r") as votersFile:
|
with open(votersFilename, 'r') as votersFile:
|
||||||
lines = votersFile.readlines()
|
lines = votersFile.readlines()
|
||||||
newlines = []
|
newlines = []
|
||||||
saveVotersFile = False
|
saveVotersFile = False
|
||||||
|
|
@ -104,7 +104,7 @@ def questionUpdateVotes(baseDir: str, nickname: str, domain: str,
|
||||||
if not possibleAnswer.get('name'):
|
if not possibleAnswer.get('name'):
|
||||||
continue
|
continue
|
||||||
totalItems = 0
|
totalItems = 0
|
||||||
with open(votersFilename, "r") as votersFile:
|
with open(votersFilename, 'r') as votersFile:
|
||||||
lines = votersFile.readlines()
|
lines = votersFile.readlines()
|
||||||
for voteLine in lines:
|
for voteLine in lines:
|
||||||
if voteLine.endswith(votersFileSeparator +
|
if voteLine.endswith(votersFileSeparator +
|
||||||
|
|
|
||||||
6
roles.py
6
roles.py
|
|
@ -81,7 +81,7 @@ def _addRole(baseDir: str, nickname: str, domain: str,
|
||||||
roleFile = baseDir + '/accounts/' + roleFilename
|
roleFile = baseDir + '/accounts/' + roleFilename
|
||||||
if os.path.isfile(roleFile):
|
if os.path.isfile(roleFile):
|
||||||
# is this nickname already in the file?
|
# is this nickname already in the file?
|
||||||
with open(roleFile, "r") as f:
|
with open(roleFile, 'r') as f:
|
||||||
lines = f.readlines()
|
lines = f.readlines()
|
||||||
for roleNickname in lines:
|
for roleNickname in lines:
|
||||||
roleNickname = roleNickname.strip('\n').strip('\r')
|
roleNickname = roleNickname.strip('\n').strip('\r')
|
||||||
|
|
@ -97,7 +97,7 @@ def _addRole(baseDir: str, nickname: str, domain: str,
|
||||||
roleNickname + '@' + domain):
|
roleNickname + '@' + domain):
|
||||||
f.write(roleNickname + '\n')
|
f.write(roleNickname + '\n')
|
||||||
else:
|
else:
|
||||||
with open(roleFile, "w+") as f:
|
with open(roleFile, 'w+') as f:
|
||||||
if os.path.isdir(baseDir + '/accounts/' +
|
if os.path.isdir(baseDir + '/accounts/' +
|
||||||
nickname + '@' + domain):
|
nickname + '@' + domain):
|
||||||
f.write(nickname + '\n')
|
f.write(nickname + '\n')
|
||||||
|
|
@ -110,7 +110,7 @@ def _removeRole(baseDir: str, nickname: str, roleFilename: str) -> None:
|
||||||
roleFile = baseDir + '/accounts/' + roleFilename
|
roleFile = baseDir + '/accounts/' + roleFilename
|
||||||
if not os.path.isfile(roleFile):
|
if not os.path.isfile(roleFile):
|
||||||
return
|
return
|
||||||
with open(roleFile, "r") as f:
|
with open(roleFile, 'r') as f:
|
||||||
lines = f.readlines()
|
lines = f.readlines()
|
||||||
with open(roleFile, 'w+') as f:
|
with open(roleFile, 'w+') as f:
|
||||||
for roleNickname in lines:
|
for roleNickname in lines:
|
||||||
|
|
|
||||||
8
tests.py
8
tests.py
|
|
@ -1406,7 +1406,7 @@ def _testFollows():
|
||||||
federationList, False)
|
federationList, False)
|
||||||
|
|
||||||
f = open(baseDir + '/accounts/' + nickname + '@' + domain +
|
f = open(baseDir + '/accounts/' + nickname + '@' + domain +
|
||||||
'/following.txt', "r")
|
'/following.txt', 'r')
|
||||||
domainFound = False
|
domainFound = False
|
||||||
for followingDomain in f:
|
for followingDomain in f:
|
||||||
testDomain = followingDomain.split('@')[1]
|
testDomain = followingDomain.split('@')[1]
|
||||||
|
|
@ -1441,7 +1441,7 @@ def _testFollows():
|
||||||
federationList, False)
|
federationList, False)
|
||||||
|
|
||||||
f = open(baseDir + '/accounts/' + nickname + '@' + domain +
|
f = open(baseDir + '/accounts/' + nickname + '@' + domain +
|
||||||
'/followers.txt', "r")
|
'/followers.txt', 'r')
|
||||||
for followerDomain in f:
|
for followerDomain in f:
|
||||||
testDomain = followerDomain.split('@')[1]
|
testDomain = followerDomain.split('@')[1]
|
||||||
testDomain = testDomain.replace('\n', '').replace('\r', '')
|
testDomain = testDomain.replace('\n', '').replace('\r', '')
|
||||||
|
|
@ -3083,10 +3083,10 @@ def _testFunctions():
|
||||||
'functions': []
|
'functions': []
|
||||||
}
|
}
|
||||||
sourceStr = ''
|
sourceStr = ''
|
||||||
with open(sourceFile, "r") as f:
|
with open(sourceFile, 'r') as f:
|
||||||
sourceStr = f.read()
|
sourceStr = f.read()
|
||||||
modules[modName]['source'] = sourceStr
|
modules[modName]['source'] = sourceStr
|
||||||
with open(sourceFile, "r") as f:
|
with open(sourceFile, 'r') as f:
|
||||||
lines = f.readlines()
|
lines = f.readlines()
|
||||||
modules[modName]['lines'] = lines
|
modules[modName]['lines'] = lines
|
||||||
lineCount = 0
|
lineCount = 0
|
||||||
|
|
|
||||||
|
|
@ -141,7 +141,7 @@ def removeDormantThreads(baseDir: str, threadsList: [], debug: bool,
|
||||||
if debug:
|
if debug:
|
||||||
sendLogFilename = baseDir + '/send.csv'
|
sendLogFilename = baseDir + '/send.csv'
|
||||||
try:
|
try:
|
||||||
with open(sendLogFilename, "a+") as logFile:
|
with open(sendLogFilename, 'a+') as logFile:
|
||||||
logFile.write(currTime.strftime("%Y-%m-%dT%H:%M:%SZ") +
|
logFile.write(currTime.strftime("%Y-%m-%dT%H:%M:%SZ") +
|
||||||
',' + str(noOfActiveThreads) +
|
',' + str(noOfActiveThreads) +
|
||||||
',' + str(len(threadsList)) + '\n')
|
',' + str(len(threadsList)) + '\n')
|
||||||
|
|
|
||||||
18
utils.py
18
utils.py
|
|
@ -189,7 +189,7 @@ def isEditor(baseDir: str, nickname: str) -> bool:
|
||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
|
||||||
with open(editorsFile, "r") as f:
|
with open(editorsFile, 'r') as f:
|
||||||
lines = f.readlines()
|
lines = f.readlines()
|
||||||
if len(lines) == 0:
|
if len(lines) == 0:
|
||||||
adminName = getConfigParam(baseDir, 'admin')
|
adminName = getConfigParam(baseDir, 'admin')
|
||||||
|
|
@ -217,7 +217,7 @@ def isArtist(baseDir: str, nickname: str) -> bool:
|
||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
|
||||||
with open(artistsFile, "r") as f:
|
with open(artistsFile, 'r') as f:
|
||||||
lines = f.readlines()
|
lines = f.readlines()
|
||||||
if len(lines) == 0:
|
if len(lines) == 0:
|
||||||
adminName = getConfigParam(baseDir, 'admin')
|
adminName = getConfigParam(baseDir, 'admin')
|
||||||
|
|
@ -427,7 +427,7 @@ def isSuspended(baseDir: str, nickname: str) -> bool:
|
||||||
|
|
||||||
suspendedFilename = baseDir + '/accounts/suspended.txt'
|
suspendedFilename = baseDir + '/accounts/suspended.txt'
|
||||||
if os.path.isfile(suspendedFilename):
|
if os.path.isfile(suspendedFilename):
|
||||||
with open(suspendedFilename, "r") as f:
|
with open(suspendedFilename, 'r') as f:
|
||||||
lines = f.readlines()
|
lines = f.readlines()
|
||||||
for suspended in lines:
|
for suspended in lines:
|
||||||
if suspended.strip('\n').strip('\r') == nickname:
|
if suspended.strip('\n').strip('\r') == nickname:
|
||||||
|
|
@ -446,7 +446,7 @@ def getFollowersList(baseDir: str,
|
||||||
if not os.path.isfile(filename):
|
if not os.path.isfile(filename):
|
||||||
return []
|
return []
|
||||||
|
|
||||||
with open(filename, "r") as f:
|
with open(filename, 'r') as f:
|
||||||
lines = f.readlines()
|
lines = f.readlines()
|
||||||
for i in range(len(lines)):
|
for i in range(len(lines)):
|
||||||
lines[i] = lines[i].strip()
|
lines[i] = lines[i].strip()
|
||||||
|
|
@ -1012,7 +1012,7 @@ def followPerson(baseDir: str, nickname: str, domain: str,
|
||||||
if handleToFollow in open(unfollowedFilename).read():
|
if handleToFollow in open(unfollowedFilename).read():
|
||||||
# remove them from the unfollowed file
|
# remove them from the unfollowed file
|
||||||
newLines = ''
|
newLines = ''
|
||||||
with open(unfollowedFilename, "r") as f:
|
with open(unfollowedFilename, 'r') as f:
|
||||||
lines = f.readlines()
|
lines = f.readlines()
|
||||||
for line in lines:
|
for line in lines:
|
||||||
if handleToFollow not in line:
|
if handleToFollow not in line:
|
||||||
|
|
@ -1229,9 +1229,9 @@ def removeModerationPostFromIndex(baseDir: str, postUrl: str,
|
||||||
return
|
return
|
||||||
postId = removeIdEnding(postUrl)
|
postId = removeIdEnding(postUrl)
|
||||||
if postId in open(moderationIndexFile).read():
|
if postId in open(moderationIndexFile).read():
|
||||||
with open(moderationIndexFile, "r") as f:
|
with open(moderationIndexFile, 'r') as f:
|
||||||
lines = f.readlines()
|
lines = f.readlines()
|
||||||
with open(moderationIndexFile, "w+") as f:
|
with open(moderationIndexFile, 'w+') as f:
|
||||||
for line in lines:
|
for line in lines:
|
||||||
if line.strip("\n").strip("\r") != postId:
|
if line.strip("\n").strip("\r") != postId:
|
||||||
f.write(line)
|
f.write(line)
|
||||||
|
|
@ -1371,7 +1371,7 @@ def _deleteHashtagsOnPost(baseDir: str, postJsonObject: {}) -> None:
|
||||||
continue
|
continue
|
||||||
# remove postId from the tag index file
|
# remove postId from the tag index file
|
||||||
lines = None
|
lines = None
|
||||||
with open(tagIndexFilename, "r") as f:
|
with open(tagIndexFilename, 'r') as f:
|
||||||
lines = f.readlines()
|
lines = f.readlines()
|
||||||
if not lines:
|
if not lines:
|
||||||
continue
|
continue
|
||||||
|
|
@ -1386,7 +1386,7 @@ def _deleteHashtagsOnPost(baseDir: str, postJsonObject: {}) -> None:
|
||||||
os.remove(tagIndexFilename)
|
os.remove(tagIndexFilename)
|
||||||
else:
|
else:
|
||||||
# write the new hashtag index without the given post in it
|
# write the new hashtag index without the given post in it
|
||||||
with open(tagIndexFilename, "w+") as f:
|
with open(tagIndexFilename, 'w+') as f:
|
||||||
f.write(newlines)
|
f.write(newlines)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -150,7 +150,7 @@ def getLeftColumnContent(baseDir: str, nickname: str, domainFull: str,
|
||||||
linksFileContainsEntries = False
|
linksFileContainsEntries = False
|
||||||
linksList = None
|
linksList = None
|
||||||
if os.path.isfile(linksFilename):
|
if os.path.isfile(linksFilename):
|
||||||
with open(linksFilename, "r") as f:
|
with open(linksFilename, 'r') as f:
|
||||||
linksList = f.readlines()
|
linksList = f.readlines()
|
||||||
|
|
||||||
if not frontPage:
|
if not frontPage:
|
||||||
|
|
|
||||||
|
|
@ -342,7 +342,7 @@ def htmlCitations(baseDir: str, nickname: str, domain: str,
|
||||||
citationsSelected = []
|
citationsSelected = []
|
||||||
if os.path.isfile(citationsFilename):
|
if os.path.isfile(citationsFilename):
|
||||||
citationsSeparator = '#####'
|
citationsSeparator = '#####'
|
||||||
with open(citationsFilename, "r") as f:
|
with open(citationsFilename, 'r') as f:
|
||||||
citations = f.readlines()
|
citations = f.readlines()
|
||||||
for line in citations:
|
for line in citations:
|
||||||
if citationsSeparator not in line:
|
if citationsSeparator not in line:
|
||||||
|
|
|
||||||
|
|
@ -411,7 +411,7 @@ def htmlNewPost(cssCache: {}, mediaInstance: bool, translate: {},
|
||||||
translate['Citations'] + ':</label></p>\n'
|
translate['Citations'] + ':</label></p>\n'
|
||||||
citationsStr += ' <ul>\n'
|
citationsStr += ' <ul>\n'
|
||||||
citationsSeparator = '#####'
|
citationsSeparator = '#####'
|
||||||
with open(citationsFilename, "r") as f:
|
with open(citationsFilename, 'r') as f:
|
||||||
citations = f.readlines()
|
citations = f.readlines()
|
||||||
for line in citations:
|
for line in citations:
|
||||||
if citationsSeparator not in line:
|
if citationsSeparator not in line:
|
||||||
|
|
|
||||||
|
|
@ -329,7 +329,7 @@ def htmlModerationInfo(cssCache: {}, translate: {},
|
||||||
|
|
||||||
suspendedFilename = baseDir + '/accounts/suspended.txt'
|
suspendedFilename = baseDir + '/accounts/suspended.txt'
|
||||||
if os.path.isfile(suspendedFilename):
|
if os.path.isfile(suspendedFilename):
|
||||||
with open(suspendedFilename, "r") as f:
|
with open(suspendedFilename, 'r') as f:
|
||||||
suspendedStr = f.read()
|
suspendedStr = f.read()
|
||||||
infoForm += '<div class="container">\n'
|
infoForm += '<div class="container">\n'
|
||||||
infoForm += ' <br><b>' + \
|
infoForm += ' <br><b>' + \
|
||||||
|
|
@ -345,7 +345,7 @@ def htmlModerationInfo(cssCache: {}, translate: {},
|
||||||
|
|
||||||
blockingFilename = baseDir + '/accounts/blocking.txt'
|
blockingFilename = baseDir + '/accounts/blocking.txt'
|
||||||
if os.path.isfile(blockingFilename):
|
if os.path.isfile(blockingFilename):
|
||||||
with open(blockingFilename, "r") as f:
|
with open(blockingFilename, 'r') as f:
|
||||||
blockedStr = f.read()
|
blockedStr = f.read()
|
||||||
infoForm += '<div class="container">\n'
|
infoForm += '<div class="container">\n'
|
||||||
infoForm += \
|
infoForm += \
|
||||||
|
|
@ -363,7 +363,7 @@ def htmlModerationInfo(cssCache: {}, translate: {},
|
||||||
|
|
||||||
filtersFilename = baseDir + '/accounts/filters.txt'
|
filtersFilename = baseDir + '/accounts/filters.txt'
|
||||||
if os.path.isfile(filtersFilename):
|
if os.path.isfile(filtersFilename):
|
||||||
with open(filtersFilename, "r") as f:
|
with open(filtersFilename, 'r') as f:
|
||||||
filteredStr = f.read()
|
filteredStr = f.read()
|
||||||
infoForm += '<div class="container">\n'
|
infoForm += '<div class="container">\n'
|
||||||
infoForm += \
|
infoForm += \
|
||||||
|
|
|
||||||
|
|
@ -1231,7 +1231,7 @@ def _htmlEditProfileInstance(baseDir: str, translate: {},
|
||||||
moderators = ''
|
moderators = ''
|
||||||
moderatorsFile = baseDir + '/accounts/moderators.txt'
|
moderatorsFile = baseDir + '/accounts/moderators.txt'
|
||||||
if os.path.isfile(moderatorsFile):
|
if os.path.isfile(moderatorsFile):
|
||||||
with open(moderatorsFile, "r") as f:
|
with open(moderatorsFile, 'r') as f:
|
||||||
moderators = f.read()
|
moderators = f.read()
|
||||||
# site moderators
|
# site moderators
|
||||||
roleAssignStr = '<details><summary class="cw">' + \
|
roleAssignStr = '<details><summary class="cw">' + \
|
||||||
|
|
@ -1251,7 +1251,7 @@ def _htmlEditProfileInstance(baseDir: str, translate: {},
|
||||||
editors = ''
|
editors = ''
|
||||||
editorsFile = baseDir + '/accounts/editors.txt'
|
editorsFile = baseDir + '/accounts/editors.txt'
|
||||||
if os.path.isfile(editorsFile):
|
if os.path.isfile(editorsFile):
|
||||||
with open(editorsFile, "r") as f:
|
with open(editorsFile, 'r') as f:
|
||||||
editors = f.read()
|
editors = f.read()
|
||||||
roleAssignStr += ' <b><label class="labels">' + \
|
roleAssignStr += ' <b><label class="labels">' + \
|
||||||
translate['Site Editors'] + '</label></b><br>\n'
|
translate['Site Editors'] + '</label></b><br>\n'
|
||||||
|
|
@ -1266,7 +1266,7 @@ def _htmlEditProfileInstance(baseDir: str, translate: {},
|
||||||
counselors = ''
|
counselors = ''
|
||||||
counselorsFile = baseDir + '/accounts/counselors.txt'
|
counselorsFile = baseDir + '/accounts/counselors.txt'
|
||||||
if os.path.isfile(counselorsFile):
|
if os.path.isfile(counselorsFile):
|
||||||
with open(counselorsFile, "r") as f:
|
with open(counselorsFile, 'r') as f:
|
||||||
counselors = f.read()
|
counselors = f.read()
|
||||||
roleAssignStr += ' <b><label class="labels">' + \
|
roleAssignStr += ' <b><label class="labels">' + \
|
||||||
translate['Counselors'] + '</label></b><br>\n'
|
translate['Counselors'] + '</label></b><br>\n'
|
||||||
|
|
@ -1280,7 +1280,7 @@ def _htmlEditProfileInstance(baseDir: str, translate: {},
|
||||||
artists = ''
|
artists = ''
|
||||||
artistsFile = baseDir + '/accounts/artists.txt'
|
artistsFile = baseDir + '/accounts/artists.txt'
|
||||||
if os.path.isfile(artistsFile):
|
if os.path.isfile(artistsFile):
|
||||||
with open(artistsFile, "r") as f:
|
with open(artistsFile, 'r') as f:
|
||||||
artists = f.read()
|
artists = f.read()
|
||||||
roleAssignStr += ' <b><label class="labels">' + \
|
roleAssignStr += ' <b><label class="labels">' + \
|
||||||
translate['Artists'] + '</label></b><br>\n'
|
translate['Artists'] + '</label></b><br>\n'
|
||||||
|
|
@ -1490,7 +1490,7 @@ def _htmlEditProfileFiltering(baseDir: str, nickname: str, domain: str,
|
||||||
if not os.path.isfile(locationsFilename):
|
if not os.path.isfile(locationsFilename):
|
||||||
locationsFilename = baseDir + '/locations.txt'
|
locationsFilename = baseDir + '/locations.txt'
|
||||||
cities = []
|
cities = []
|
||||||
with open(locationsFilename, "r") as f:
|
with open(locationsFilename, 'r') as f:
|
||||||
cities = f.readlines()
|
cities = f.readlines()
|
||||||
cities.sort()
|
cities.sort()
|
||||||
editProfileForm += ' <select id="cityDropdown" ' + \
|
editProfileForm += ' <select id="cityDropdown" ' + \
|
||||||
|
|
|
||||||
|
|
@ -662,7 +662,7 @@ def htmlHashtagSearch(cssCache: {},
|
||||||
nickname = None
|
nickname = None
|
||||||
|
|
||||||
# read the index
|
# read the index
|
||||||
with open(hashtagIndexFile, "r") as f:
|
with open(hashtagIndexFile, 'r') as f:
|
||||||
lines = f.readlines()
|
lines = f.readlines()
|
||||||
|
|
||||||
# read the css
|
# read the css
|
||||||
|
|
@ -841,7 +841,7 @@ def rssHashtagSearch(nickname: str, domain: str, port: int,
|
||||||
|
|
||||||
# read the index
|
# read the index
|
||||||
lines = []
|
lines = []
|
||||||
with open(hashtagIndexFile, "r") as f:
|
with open(hashtagIndexFile, 'r') as f:
|
||||||
lines = f.readlines()
|
lines = f.readlines()
|
||||||
if not lines:
|
if not lines:
|
||||||
return None
|
return None
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue