From d9298185323a81cc2627f62fa414a5bc816e698a Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Wed, 7 Aug 2019 17:09:53 +0100 Subject: [PATCH] debug --- daemon.py | 5 +++++ manualapprove.py | 8 ++++++++ 2 files changed, 13 insertions(+) diff --git a/daemon.py b/daemon.py index d1a23d2a0..efc82cb4f 100644 --- a/daemon.py +++ b/daemon.py @@ -754,10 +754,15 @@ class PubServer(BaseHTTPRequestHandler): originPathStr=self.path.split('/followapprove=')[0] followerNickname=originPathStr.replace('/users/','') followingHandle=self.path.split('/followapprove=')[1] + print('*********************************************') + print('followingHandle: '+followingHandle) + print('followerNickname: '+followerNickname) if '@' in followingHandle: + print('Test1') if not self.server.session: self.server.session= \ createSession(self.server.domain,self.server.port,self.server.useTor) + print('Test2') manualApproveFollowRequest(self.server.session, \ self.server.baseDir, \ self.server.httpPrefix, \ diff --git a/manualapprove.py b/manualapprove.py index 1954e92b2..763aa3b67 100644 --- a/manualapprove.py +++ b/manualapprove.py @@ -44,6 +44,7 @@ def manualApproveFollowRequest(session,baseDir: str, \ debug: bool) -> None: """Manually approve a follow request """ + print('Test3') handle=nickname+'@'+domain accountsDir=baseDir+'/accounts/'+handle approveFollowsFilename=accountsDir+'/followrequests.txt' @@ -55,17 +56,22 @@ def manualApproveFollowRequest(session,baseDir: str, \ if debug: print(handle+' not in '+approveFollowsFilename) return + print('Test4') approvefilenew = open(approveFollowsFilename+'.new', 'w+') with open(approveFollowsFilename, 'r') as approvefile: for handle in approvefile: if handle.startswith(approveHandle): + print('Test5: '+handle) port2=port if ':' in handle: port2=int(handle.split(':')[1].replace('\n','')) requestsDir=accountsDir+'/requests' followActivityfilename=requestsDir+'/'+handle+'.follow' + print('Test6: '+followActivityfilename) if os.path.isfile(followActivityfilename): + print('Test6') with open(followActivityfilename, 'r') as fp: + print('Test7') followJson=commentjson.load(fp) approveNickname=approveHandle.split('@')[0] approveDomain=approveHandle.split('@')[1].replace('\n','') @@ -73,6 +79,7 @@ def manualApproveFollowRequest(session,baseDir: str, \ if ':' in approveDomain: approvePort=approveDomain.split(':')[1] approveDomain=approveDomain.split(':')[0] + print('Test8: '+approveNickname+' '+approveDomain+' '+approvePort+' '+followJson['actor']) followedAccountAccepts(session,baseDir,httpPrefix, \ nickname,domain,port, \ approveNickname,approveDomain,approvePort, \ @@ -81,6 +88,7 @@ def manualApproveFollowRequest(session,baseDir: str, \ sendThreads,postLog, \ cachedWebfingers,personCache, \ debug) + print("Test9") os.remove(followActivityfilename) else: approvefilenew.write(handle)