forked from indymedia/epicyon
Consistent append
parent
7a0914253e
commit
28830ed660
2
auth.py
2
auth.py
|
@ -130,7 +130,7 @@ def storeBasicCredentials(baseDir: str, nickname: str, password: str) -> bool:
|
||||||
os.rename(passwordFile + '.new', passwordFile)
|
os.rename(passwordFile + '.new', passwordFile)
|
||||||
else:
|
else:
|
||||||
# append to password file
|
# append to password file
|
||||||
with open(passwordFile, "a") as passfile:
|
with open(passwordFile, 'a+') as passfile:
|
||||||
passfile.write(storeStr + '\n')
|
passfile.write(storeStr + '\n')
|
||||||
else:
|
else:
|
||||||
with open(passwordFile, "w") as passfile:
|
with open(passwordFile, "w") as passfile:
|
||||||
|
|
|
@ -520,7 +520,7 @@ def storeFollowRequest(baseDir: str,
|
||||||
approveFollowsFilename = accountsDir + '/followrequests.txt'
|
approveFollowsFilename = accountsDir + '/followrequests.txt'
|
||||||
if os.path.isfile(approveFollowsFilename):
|
if os.path.isfile(approveFollowsFilename):
|
||||||
if approveHandle not in open(approveFollowsFilename).read():
|
if approveHandle not in open(approveFollowsFilename).read():
|
||||||
with open(approveFollowsFilename, "a") as fp:
|
with open(approveFollowsFilename, 'a+') as fp:
|
||||||
fp.write(approveHandle + '\n')
|
fp.write(approveHandle + '\n')
|
||||||
else:
|
else:
|
||||||
if debug:
|
if debug:
|
||||||
|
|
2
inbox.py
2
inbox.py
|
@ -1581,7 +1581,7 @@ def populateReplies(baseDir: str, httpPrefix: str, domain: str,
|
||||||
if numLines > maxReplies:
|
if numLines > maxReplies:
|
||||||
return False
|
return False
|
||||||
if messageId not in open(postRepliesFilename).read():
|
if messageId not in open(postRepliesFilename).read():
|
||||||
repliesFile = open(postRepliesFilename, "a")
|
repliesFile = open(postRepliesFilename, 'a+')
|
||||||
repliesFile.write(messageId + '\n')
|
repliesFile.write(messageId + '\n')
|
||||||
repliesFile.close()
|
repliesFile.close()
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in New Issue