mirror of https://gitlab.com/bashrc2/epicyon
Check for actor in each line of the accept or reject file
parent
79faa91534
commit
d60abc89f1
13
follow.py
13
follow.py
|
@ -108,17 +108,20 @@ def _removeFromFollowBase(baseDir: str,
|
||||||
'://' + acceptDenyDomain + '/' + \
|
'://' + acceptDenyDomain + '/' + \
|
||||||
usersName + '/' + acceptDenyNickname
|
usersName + '/' + acceptDenyNickname
|
||||||
if acceptDenyActor in open(approveFollowsFilename).read():
|
if acceptDenyActor in open(approveFollowsFilename).read():
|
||||||
# actor found, so use it in the subsequent removal
|
|
||||||
approveHandle = acceptDenyActor
|
|
||||||
actorFound = True
|
actorFound = True
|
||||||
break
|
break
|
||||||
if not actorFound:
|
if not actorFound:
|
||||||
return
|
return
|
||||||
approvefilenew = open(approveFollowsFilename + '.new', 'w+')
|
approvefilenew = open(approveFollowsFilename + '.new', 'w+')
|
||||||
with open(approveFollowsFilename, 'r') as approvefile:
|
with open(approveFollowsFilename, 'r') as approvefile:
|
||||||
for approveHandle in approvefile:
|
if not acceptDenyActor:
|
||||||
if not approveHandle.startswith(acceptOrDenyHandle):
|
for approveHandle in approvefile:
|
||||||
approvefilenew.write(approveHandle)
|
if not approveHandle.startswith(acceptOrDenyHandle):
|
||||||
|
approvefilenew.write(approveHandle)
|
||||||
|
else:
|
||||||
|
for approveHandle in approvefile:
|
||||||
|
if acceptDenyActor not in approveHandle:
|
||||||
|
approvefilenew.write(approveHandle)
|
||||||
approvefilenew.close()
|
approvefilenew.close()
|
||||||
os.rename(approveFollowsFilename + '.new', approveFollowsFilename)
|
os.rename(approveFollowsFilename + '.new', approveFollowsFilename)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue