Remove debug

master
Bob Mottram 2019-08-07 18:02:28 +01:00
parent 5cd34b452e
commit aa3c0f5fb8
2 changed files with 0 additions and 15 deletions

View File

@ -749,22 +749,15 @@ class PubServer(BaseHTTPRequestHandler):
self._redirect_headers(actor+'/inbox',cookie) self._redirect_headers(actor+'/inbox',cookie)
return return
print('88888888888888888888888888888888888888888888888888')
print(str(authorized)+' '+self.path)
# send a follow request approval from the web interface # send a follow request approval from the web interface
if authorized and '/followapprove=' in self.path and self.path.startswith('/users/'): if authorized and '/followapprove=' in self.path and self.path.startswith('/users/'):
originPathStr=self.path.split('/followapprove=')[0] originPathStr=self.path.split('/followapprove=')[0]
followerNickname=originPathStr.replace('/users/','') followerNickname=originPathStr.replace('/users/','')
followingHandle=self.path.split('/followapprove=')[1] followingHandle=self.path.split('/followapprove=')[1]
print('*********************************************')
print('followingHandle: '+followingHandle)
print('followerNickname: '+followerNickname)
if '@' in followingHandle: if '@' in followingHandle:
print('Test1')
if not self.server.session: if not self.server.session:
self.server.session= \ self.server.session= \
createSession(self.server.domain,self.server.port,self.server.useTor) createSession(self.server.domain,self.server.port,self.server.useTor)
print('Test2')
manualApproveFollowRequest(self.server.session, \ manualApproveFollowRequest(self.server.session, \
self.server.baseDir, \ self.server.baseDir, \
self.server.httpPrefix, \ self.server.httpPrefix, \

View File

@ -44,7 +44,6 @@ def manualApproveFollowRequest(session,baseDir: str, \
debug: bool) -> None: debug: bool) -> None:
"""Manually approve a follow request """Manually approve a follow request
""" """
print('Test3')
handle=nickname+'@'+domain handle=nickname+'@'+domain
accountsDir=baseDir+'/accounts/'+handle accountsDir=baseDir+'/accounts/'+handle
approveFollowsFilename=accountsDir+'/followrequests.txt' approveFollowsFilename=accountsDir+'/followrequests.txt'
@ -56,23 +55,18 @@ def manualApproveFollowRequest(session,baseDir: str, \
if debug: if debug:
print(handle+' not in '+approveFollowsFilename) print(handle+' not in '+approveFollowsFilename)
return return
print('Test4')
approvefilenew = open(approveFollowsFilename+'.new', 'w+') approvefilenew = open(approveFollowsFilename+'.new', 'w+')
with open(approveFollowsFilename, 'r') as approvefile: with open(approveFollowsFilename, 'r') as approvefile:
for handle in approvefile: for handle in approvefile:
if handle.startswith(approveHandle): if handle.startswith(approveHandle):
handle=handle.replace('\n','') handle=handle.replace('\n','')
print('Test5: '+handle)
port2=port port2=port
if ':' in handle: if ':' in handle:
port2=int(handle.split(':')[1]) port2=int(handle.split(':')[1])
requestsDir=accountsDir+'/requests' requestsDir=accountsDir+'/requests'
followActivityfilename=requestsDir+'/'+handle+'.follow' followActivityfilename=requestsDir+'/'+handle+'.follow'
print('Test6: '+followActivityfilename)
if os.path.isfile(followActivityfilename): if os.path.isfile(followActivityfilename):
print('Test7')
with open(followActivityfilename, 'r') as fp: with open(followActivityfilename, 'r') as fp:
print('Test8')
followJson=commentjson.load(fp) followJson=commentjson.load(fp)
approveNickname=approveHandle.split('@')[0] approveNickname=approveHandle.split('@')[0]
approveDomain=approveHandle.split('@')[1].replace('\n','') approveDomain=approveHandle.split('@')[1].replace('\n','')
@ -80,7 +74,6 @@ def manualApproveFollowRequest(session,baseDir: str, \
if ':' in approveDomain: if ':' in approveDomain:
approvePort=approveDomain.split(':')[1] approvePort=approveDomain.split(':')[1]
approveDomain=approveDomain.split(':')[0] approveDomain=approveDomain.split(':')[0]
print('Test9: '+approveNickname+' '+approveDomain+' '+approvePort+' '+followJson['actor'])
followedAccountAccepts(session,baseDir,httpPrefix, \ followedAccountAccepts(session,baseDir,httpPrefix, \
nickname,domain,port, \ nickname,domain,port, \
approveNickname,approveDomain,approvePort, \ approveNickname,approveDomain,approvePort, \
@ -89,7 +82,6 @@ def manualApproveFollowRequest(session,baseDir: str, \
sendThreads,postLog, \ sendThreads,postLog, \
cachedWebfingers,personCache, \ cachedWebfingers,personCache, \
debug) debug)
print("Test10")
os.remove(followActivityfilename) os.remove(followActivityfilename)
else: else:
approvefilenew.write(handle) approvefilenew.write(handle)