forked from indymedia/epicyon
Also archive replies
parent
cf8fe6c20e
commit
655c03e6a1
|
@ -506,7 +506,7 @@ if args.archive:
|
||||||
archiveMedia(baseDir,args.archive,archiveWeeks)
|
archiveMedia(baseDir,args.archive,archiveWeeks)
|
||||||
archivePosts(baseDir,args.archive,archiveMaxPosts)
|
archivePosts(baseDir,args.archive,archiveMaxPosts)
|
||||||
print('Archiving complete')
|
print('Archiving complete')
|
||||||
sys.exit()
|
sys.exit()
|
||||||
|
|
||||||
if not args.domain and not domain:
|
if not args.domain and not domain:
|
||||||
print('Specify a domain with --domain [name]')
|
print('Specify a domain with --domain [name]')
|
||||||
|
|
7
posts.py
7
posts.py
|
@ -997,13 +997,18 @@ def archivePostsForPerson(nickname: str,domain: str,baseDir: str, \
|
||||||
return
|
return
|
||||||
|
|
||||||
for postFilename in postsInBox:
|
for postFilename in postsInBox:
|
||||||
filePath = os.path.join(boxDir, postFilename)
|
filePath = os.path.join(boxDir, postFilename)
|
||||||
if os.path.isfile(filePath):
|
if os.path.isfile(filePath):
|
||||||
|
repliesPath=filePath.replace('.json','.replies')
|
||||||
if archiveDir:
|
if archiveDir:
|
||||||
archivePath = os.path.join(archiveDir, postFilename)
|
archivePath = os.path.join(archiveDir, postFilename)
|
||||||
os.rename(filePath,archivePath)
|
os.rename(filePath,archivePath)
|
||||||
|
if os.path.isfile(repliesPath):
|
||||||
|
os.rename(repliesPath,archivePath)
|
||||||
else:
|
else:
|
||||||
os.remove(filePath)
|
os.remove(filePath)
|
||||||
|
if os.path.isfile(repliesPath):
|
||||||
|
os.remove(repliesPath)
|
||||||
noOfPosts -= 1
|
noOfPosts -= 1
|
||||||
if noOfPosts <= maxPostsInBox:
|
if noOfPosts <= maxPostsInBox:
|
||||||
break
|
break
|
||||||
|
|
Loading…
Reference in New Issue