main2
Bob Mottram 2019-09-24 22:16:44 +01:00
parent a2b5e591c6
commit 5155c1f05e
1 changed files with 13 additions and 12 deletions

View File

@ -1990,18 +1990,19 @@ def archivePostsForPerson(httpPrefix: str,nickname: str,domain: str,baseDir: str
for statusNumber,postFilename in postsInBox.items(): for statusNumber,postFilename in postsInBox.items():
filePath = os.path.join(boxDir, postFilename) filePath = os.path.join(boxDir, postFilename)
if os.path.isfile(filePath): if not os.path.isfile(filePath):
if archiveDir: continue
repliesPath=filePath.replace('.json','.replies') if archiveDir:
archivePath = os.path.join(archiveDir, postFilename) repliesPath=filePath.replace('.json','.replies')
os.rename(filePath,archivePath) archivePath = os.path.join(archiveDir, postFilename)
if os.path.isfile(repliesPath): os.rename(filePath,archivePath)
os.rename(repliesPath,archivePath) if os.path.isfile(repliesPath):
else: os.rename(repliesPath,archivePath)
deletePost(baseDir,httpPrefix,nickname,domain,filePath,False) else:
noOfPosts -= 1 deletePost(baseDir,httpPrefix,nickname,domain,filePath,False)
if noOfPosts <= maxPostsInBox: noOfPosts -= 1
break if noOfPosts <= maxPostsInBox:
break
def getPublicPostsOfPerson(baseDir: str,nickname: str,domain: str, \ def getPublicPostsOfPerson(baseDir: str,nickname: str,domain: str, \
raw: bool,simple: bool,useTor: bool, \ raw: bool,simple: bool,useTor: bool, \