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