mirror of https://gitlab.com/bashrc2/epicyon
Tidying
parent
0c8d3ab698
commit
664d087b01
26
utils.py
26
utils.py
|
@ -339,28 +339,20 @@ 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()
|
||||||
|
|
||||||
boxName = 'inbox'
|
# search boxes
|
||||||
postFilename = baseDir + '/accounts/' + nickname + '@' + domain + \
|
boxes = ('inbox', 'outbox', 'tlblogs')
|
||||||
'/' + boxName + '/' + postUrl + '.' + extension
|
for boxName in boxes:
|
||||||
if os.path.isfile(postFilename):
|
postFilename = baseDir + '/accounts/' + nickname + '@' + domain + \
|
||||||
return postFilename
|
'/' + boxName + '/' + postUrl + '.' + extension
|
||||||
|
if os.path.isfile(postFilename):
|
||||||
boxName = 'outbox'
|
return postFilename
|
||||||
postFilename = baseDir + '/accounts/' + nickname + '@' + domain + \
|
|
||||||
'/' + boxName + '/' + postUrl + '.' + extension
|
|
||||||
if os.path.isfile(postFilename):
|
|
||||||
return postFilename
|
|
||||||
|
|
||||||
boxName = 'tlblogs'
|
|
||||||
postFilename = baseDir + '/accounts/' + nickname + '@' + domain + \
|
|
||||||
'/' + boxName + '/' + postUrl + '.'+extension
|
|
||||||
if os.path.isfile(postFilename):
|
|
||||||
return postFilename
|
|
||||||
|
|
||||||
|
# is it in the announce cache?
|
||||||
postFilename = baseDir + '/cache/announce/' + \
|
postFilename = baseDir + '/cache/announce/' + \
|
||||||
nickname + '/' + postUrl + '.' + extension
|
nickname + '/' + postUrl + '.' + extension
|
||||||
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 + '.' + extension)
|
||||||
return None
|
return None
|
||||||
|
|
Loading…
Reference in New Issue