mirror of https://gitlab.com/bashrc2/epicyon
Tidying
parent
664d087b01
commit
21c5db8ab4
11
utils.py
11
utils.py
|
@ -339,22 +339,25 @@ def locatePost(baseDir: str, nickname: str, domain: str,
|
||||||
# if this post in the shared inbox?
|
# if this post in the shared inbox?
|
||||||
postUrl = postUrl.replace('/', '#').replace('/activity', '').strip()
|
postUrl = postUrl.replace('/', '#').replace('/activity', '').strip()
|
||||||
|
|
||||||
|
# add the extension
|
||||||
|
postUrl = postUrl + '.' + extension
|
||||||
|
|
||||||
# search boxes
|
# search boxes
|
||||||
boxes = ('inbox', 'outbox', 'tlblogs')
|
boxes = ('inbox', 'outbox', 'tlblogs')
|
||||||
|
accountDir = baseDir + '/accounts/' + nickname + '@' + domain + '/'
|
||||||
for boxName in boxes:
|
for boxName in boxes:
|
||||||
postFilename = baseDir + '/accounts/' + nickname + '@' + domain + \
|
postFilename = accountDir + boxName + '/' + postUrl
|
||||||
'/' + boxName + '/' + postUrl + '.' + extension
|
|
||||||
if os.path.isfile(postFilename):
|
if os.path.isfile(postFilename):
|
||||||
return postFilename
|
return postFilename
|
||||||
|
|
||||||
# is it in the announce cache?
|
# is it in the announce cache?
|
||||||
postFilename = baseDir + '/cache/announce/' + \
|
postFilename = baseDir + '/cache/announce/' + \
|
||||||
nickname + '/' + postUrl + '.' + extension
|
nickname + '/' + postUrl
|
||||||
if os.path.isfile(postFilename):
|
if os.path.isfile(postFilename):
|
||||||
return postFilename
|
return postFilename
|
||||||
|
|
||||||
print('WARN: unable to locate ' + nickname + ' ' +
|
print('WARN: unable to locate ' + nickname + ' ' +
|
||||||
postUrl + '.' + extension)
|
postUrl)
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue