More debug

main
Bob Mottram 2019-11-18 14:42:18 +00:00
parent 026ef6e194
commit 8ead5da34a
1 changed files with 22 additions and 13 deletions

View File

@ -243,24 +243,33 @@ def locatePost(baseDir: str,nickname: str,domain: str,postUrl: str,replies=False
extension='json' extension='json'
else: else:
extension='replies' extension='replies'
# if this post in the shared inbox? # if this post in the shared inbox?
handle='inbox@'+domain handle='inbox@'+domain
boxName='inbox'
postUrl=postUrl.replace('/','#').replace('/activity','') postUrl=postUrl.replace('/','#').replace('/activity','')
boxName='inbox'
postFilename=baseDir+'/accounts/'+nickname+'@'+domain+'/'+boxName+'/'+postUrl+'.'+extension postFilename=baseDir+'/accounts/'+nickname+'@'+domain+'/'+boxName+'/'+postUrl+'.'+extension
if not os.path.isfile(postFilename): if os.path.isfile(postFilename):
return postFilename
boxName='outbox' boxName='outbox'
postFilename=baseDir+'/accounts/'+nickname+'@'+domain+'/'+boxName+'/'+postUrl+'.'+extension postFilename=baseDir+'/accounts/'+nickname+'@'+domain+'/'+boxName+'/'+postUrl+'.'+extension
if not os.path.isfile(postFilename): if os.path.isfile(postFilename):
return postFilename
# if this post in the inbox of the person? # if this post in the inbox of the person?
boxName='inbox' boxName='inbox'
postFilename=baseDir+'/accounts/'+nickname+'@'+domain+'/'+boxName+'/'+postUrl+'.'+extension postFilename=baseDir+'/accounts/'+nickname+'@'+domain+'/'+boxName+'/'+postUrl+'.'+extension
if not os.path.isfile(postFilename): if os.path.isfile(postFilename):
postFilename=baseDir+'/cache/announce/'+nickname+'/'+postUrl+'.'+extension
if not os.path.isfile(postFilename):
postFilename=None
return postFilename return postFilename
postFilename=baseDir+'/cache/announce/'+nickname+'/'+postUrl+'.'+extension
if os.path.isfile(postFilename):
return postFilename
print('WARN: unable to locate '+nickname+' '+postUrl+'.'+extension)
return None
def removeAttachment(baseDir: str,httpPrefix: str,domain: str,postJson: {}): def removeAttachment(baseDir: str,httpPrefix: str,domain: str,postJson: {}):
if not postJson.get('attachment'): if not postJson.get('attachment'):
return return