forked from indymedia/epicyon
Comments
parent
d5248ea2d6
commit
d0085e1c33
|
@ -222,20 +222,24 @@ def updateNewswireModerationQueue(baseDir: str, handle: str,
|
||||||
moderationStatusFilename = fullPostFilename + '.moderate'
|
moderationStatusFilename = fullPostFilename + '.moderate'
|
||||||
moderationStatusStr = ''
|
moderationStatusStr = ''
|
||||||
if not os.path.isfile(moderationStatusFilename):
|
if not os.path.isfile(moderationStatusFilename):
|
||||||
|
# create a file used to keep track of moderation status
|
||||||
|
moderationStatusStr = '[waiting]'
|
||||||
statusFile = open(moderationStatusFilename, "w+")
|
statusFile = open(moderationStatusFilename, "w+")
|
||||||
if statusFile:
|
if statusFile:
|
||||||
statusFile.write('[waiting]')
|
statusFile.write(moderationStatusStr)
|
||||||
statusFile.close()
|
statusFile.close()
|
||||||
moderationStatusStr = '[waiting]'
|
|
||||||
else:
|
else:
|
||||||
|
# read the moderation status file
|
||||||
statusFile = open(moderationStatusFilename, "r")
|
statusFile = open(moderationStatusFilename, "r")
|
||||||
if statusFile:
|
if statusFile:
|
||||||
moderationStatusStr = statusFile.read()
|
moderationStatusStr = statusFile.read()
|
||||||
statusFile.close()
|
statusFile.close()
|
||||||
|
|
||||||
|
# if the post is still in the moderation queue
|
||||||
if '[accepted]' not in \
|
if '[accepted]' not in \
|
||||||
open(moderationStatusFilename).read():
|
open(moderationStatusFilename).read():
|
||||||
|
|
||||||
|
# load the post and add its details to the moderation queue
|
||||||
postJsonObject = None
|
postJsonObject = None
|
||||||
if fullPostFilename:
|
if fullPostFilename:
|
||||||
postJsonObject = loadJson(fullPostFilename)
|
postJsonObject = loadJson(fullPostFilename)
|
||||||
|
@ -355,6 +359,7 @@ def addBlogsToNewswire(baseDir: str, newswire: {},
|
||||||
# sort the moderation dict into chronological order, latest first
|
# sort the moderation dict into chronological order, latest first
|
||||||
sortedModerationDict = \
|
sortedModerationDict = \
|
||||||
OrderedDict(sorted(moderationDict.items(), reverse=True))
|
OrderedDict(sorted(moderationDict.items(), reverse=True))
|
||||||
|
# save the moderation queue details for later display
|
||||||
newswireModerationFilename = baseDir + '/accounts/newswiremoderation.txt'
|
newswireModerationFilename = baseDir + '/accounts/newswiremoderation.txt'
|
||||||
saveJson(sortedModerationDict, newswireModerationFilename)
|
saveJson(sortedModerationDict, newswireModerationFilename)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue