forked from indymedia/epicyon
Tidying
parent
aa7a63e891
commit
1500e8e02e
20
daemon.py
20
daemon.py
|
@ -5591,12 +5591,13 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
print('Newswire item date: ' + dateStr)
|
print('Newswire item date: ' + dateStr)
|
||||||
if newswire.get(dateStr):
|
if newswire.get(dateStr):
|
||||||
if isModerator(baseDir, nickname):
|
if isModerator(baseDir, nickname):
|
||||||
print('Voting on newswire item: ' + str(newswire[dateStr]))
|
newswireItem = newswire[dateStr]
|
||||||
|
print('Voting on newswire item: ' + str(newswireItem))
|
||||||
votesIndex = 2
|
votesIndex = 2
|
||||||
filenameIndex = 3
|
filenameIndex = 3
|
||||||
if 'vote:' + nickname not in newswire[dateStr][votesIndex]:
|
if 'vote:' + nickname not in newswireItem[votesIndex]:
|
||||||
newswire[dateStr][votesIndex].append('vote:' + nickname)
|
newswireItem[votesIndex].append('vote:' + nickname)
|
||||||
filename = newswire[dateStr][filenameIndex]
|
filename = newswireItem[filenameIndex]
|
||||||
newswireStateFilename = \
|
newswireStateFilename = \
|
||||||
baseDir + '/accounts/.newswirestate.json'
|
baseDir + '/accounts/.newswirestate.json'
|
||||||
try:
|
try:
|
||||||
|
@ -5604,7 +5605,7 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print('ERROR saving newswire state, ' + str(e))
|
print('ERROR saving newswire state, ' + str(e))
|
||||||
if filename:
|
if filename:
|
||||||
saveJson(newswire[dateStr][votesIndex],
|
saveJson(newswireItem[votesIndex],
|
||||||
filename + '.votes')
|
filename + '.votes')
|
||||||
else:
|
else:
|
||||||
print('No newswire item with date: ' + dateStr + ' ' +
|
print('No newswire item with date: ' + dateStr + ' ' +
|
||||||
|
@ -5648,9 +5649,10 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
if isModerator(baseDir, nickname):
|
if isModerator(baseDir, nickname):
|
||||||
votesIndex = 2
|
votesIndex = 2
|
||||||
filenameIndex = 3
|
filenameIndex = 3
|
||||||
if 'vote:' + nickname in newswire[dateStr][votesIndex]:
|
newswireItem = newswire[dateStr]
|
||||||
newswire[dateStr][votesIndex].remove('vote:' + nickname)
|
if 'vote:' + nickname in newswireItem[votesIndex]:
|
||||||
filename = newswire[dateStr][filenameIndex]
|
newswireItem[votesIndex].remove('vote:' + nickname)
|
||||||
|
filename = newswireItem[filenameIndex]
|
||||||
newswireStateFilename = \
|
newswireStateFilename = \
|
||||||
baseDir + '/accounts/.newswirestate.json'
|
baseDir + '/accounts/.newswirestate.json'
|
||||||
try:
|
try:
|
||||||
|
@ -5658,7 +5660,7 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print('ERROR saving newswire state, ' + str(e))
|
print('ERROR saving newswire state, ' + str(e))
|
||||||
if filename:
|
if filename:
|
||||||
saveJson(newswire[dateStr][votesIndex],
|
saveJson(newswireItem[votesIndex],
|
||||||
filename + '.votes')
|
filename + '.votes')
|
||||||
else:
|
else:
|
||||||
print('No newswire item with date: ' + dateStr + ' ' +
|
print('No newswire item with date: ' + dateStr + ' ' +
|
||||||
|
|
Loading…
Reference in New Issue