forked from indymedia/epicyon
Also archive replies
parent
cf8fe6c20e
commit
655c03e6a1
5
posts.py
5
posts.py
|
@ -999,11 +999,16 @@ def archivePostsForPerson(nickname: str,domain: str,baseDir: str, \
|
|||
for postFilename in postsInBox:
|
||||
filePath = os.path.join(boxDir, postFilename)
|
||||
if os.path.isfile(filePath):
|
||||
repliesPath=filePath.replace('.json','.replies')
|
||||
if archiveDir:
|
||||
archivePath = os.path.join(archiveDir, postFilename)
|
||||
os.rename(filePath,archivePath)
|
||||
if os.path.isfile(repliesPath):
|
||||
os.rename(repliesPath,archivePath)
|
||||
else:
|
||||
os.remove(filePath)
|
||||
if os.path.isfile(repliesPath):
|
||||
os.remove(repliesPath)
|
||||
noOfPosts -= 1
|
||||
if noOfPosts <= maxPostsInBox:
|
||||
break
|
||||
|
|
Loading…
Reference in New Issue