forked from indymedia/epicyon
Tidying
parent
e8e347199c
commit
f189994879
|
@ -18,7 +18,8 @@ def manualDenyFollowRequest(baseDir: str,nickname: str,domain: str,denyHandle: s
|
||||||
handle=args.nickname+'@'+domain
|
handle=args.nickname+'@'+domain
|
||||||
accountsDir=baseDir+'/accounts/'+handle
|
accountsDir=baseDir+'/accounts/'+handle
|
||||||
approveFollowsFilename=accountsDir+'/followrequests.txt'
|
approveFollowsFilename=accountsDir+'/followrequests.txt'
|
||||||
if handle in open(approveFollowsFilename).read():
|
if handle not in open(approveFollowsFilename).read():
|
||||||
|
return
|
||||||
with open(approveFollowsFilename+'.new', 'w') as approvefilenew:
|
with open(approveFollowsFilename+'.new', 'w') as approvefilenew:
|
||||||
with open(approveFollowsFilename, 'r') as approvefile:
|
with open(approveFollowsFilename, 'r') as approvefile:
|
||||||
for approveHandle in approvefile:
|
for approveHandle in approvefile:
|
||||||
|
@ -35,13 +36,20 @@ def manualApproveFollowRequest(session,baseDir: str, \
|
||||||
sendThreads: [],postLog: [], \
|
sendThreads: [],postLog: [], \
|
||||||
cachedWebfingers: {},personCache: {}, \
|
cachedWebfingers: {},personCache: {}, \
|
||||||
acceptedCaps: [], \
|
acceptedCaps: [], \
|
||||||
debug: bool):
|
debug: bool) -> None:
|
||||||
"""Manually approve a follow request
|
"""Manually approve a follow request
|
||||||
"""
|
"""
|
||||||
handle=nickname+'@'+domain
|
handle=nickname+'@'+domain
|
||||||
accountsDir=baseDir+'/accounts/'+handle
|
accountsDir=baseDir+'/accounts/'+handle
|
||||||
approveFollowsFilename=accountsDir+'/followrequests.txt'
|
approveFollowsFilename=accountsDir+'/followrequests.txt'
|
||||||
if handle in open(approveFollowsFilename).read():
|
if not os.path.isfile(approveFollowsFilename):
|
||||||
|
if debug:
|
||||||
|
print('WARN: Follow requests file '+approveFollowsFilename+' not found')
|
||||||
|
return
|
||||||
|
if handle not in open(approveFollowsFilename).read():
|
||||||
|
if debug:
|
||||||
|
print(handle+' not in '+approveFollowsFilename)
|
||||||
|
return
|
||||||
with open(approveFollowsFilename+'.new', 'w') as approvefilenew:
|
with open(approveFollowsFilename+'.new', 'w') as approvefilenew:
|
||||||
with open(approveFollowsFilename, 'r') as approvefile:
|
with open(approveFollowsFilename, 'r') as approvefile:
|
||||||
for handle in approvefile:
|
for handle in approvefile:
|
||||||
|
|
Loading…
Reference in New Issue