forked from indymedia/epicyon
Search different boxes
parent
e5c8e91a62
commit
c170a8b5c8
32
blog.py
32
blog.py
|
@ -39,11 +39,19 @@ def noOfBlogReplies(baseDir: str,httpPrefix: str,translate: {}, \
|
||||||
return 0
|
return 0
|
||||||
if not postId:
|
if not postId:
|
||||||
return 0
|
return 0
|
||||||
postFilename= \
|
|
||||||
baseDir+'/accounts/'+nickname+'@'+domain+'/tlblogs/'+ \
|
tryPostBox=('tlblogs','inbox','outbox')
|
||||||
postId.replace('/','#')+'.replies'
|
boxFound=False
|
||||||
if not os.path.isfile(postFilename):
|
for postBox in tryPostBox:
|
||||||
|
postFilename= \
|
||||||
|
baseDir+'/accounts/'+nickname+'@'+domain+'/'+postBox+'/'+ \
|
||||||
|
postId.replace('/','#')+'.replies'
|
||||||
|
if os.path.isfile(postFilename):
|
||||||
|
boxFound=True
|
||||||
|
break
|
||||||
|
if not boxFound:
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
replies=0
|
replies=0
|
||||||
with open(postFilename, "r") as f:
|
with open(postFilename, "r") as f:
|
||||||
lines = f.readlines()
|
lines = f.readlines()
|
||||||
|
@ -67,11 +75,19 @@ def getBlogReplies(baseDir: str,httpPrefix: str,translate: {}, \
|
||||||
return ''
|
return ''
|
||||||
if not postId:
|
if not postId:
|
||||||
return ''
|
return ''
|
||||||
postFilename= \
|
|
||||||
baseDir+'/accounts/'+nickname+'@'+domain+'/tlblogs/'+ \
|
tryPostBox=('tlblogs','inbox','outbox')
|
||||||
postId.replace('/','#')+'.replies'
|
boxFound=False
|
||||||
if not os.path.isfile(postFilename):
|
for postBox in tryPostBox:
|
||||||
|
postFilename= \
|
||||||
|
baseDir+'/accounts/'+nickname+'@'+domain+'/'+postBox+'/'+ \
|
||||||
|
postId.replace('/','#')+'.replies'
|
||||||
|
if os.path.isfile(postFilename):
|
||||||
|
boxFound=True
|
||||||
|
break
|
||||||
|
if not boxFound:
|
||||||
return ''
|
return ''
|
||||||
|
|
||||||
with open(postFilename, "r") as f:
|
with open(postFilename, "r") as f:
|
||||||
lines = f.readlines()
|
lines = f.readlines()
|
||||||
repliesStr=''
|
repliesStr=''
|
||||||
|
|
Loading…
Reference in New Issue