mirror of https://gitlab.com/bashrc2/epicyon
Edit filtered words for newswire
parent
651f2b41e4
commit
996499a223
11
daemon.py
11
daemon.py
|
@ -2973,6 +2973,17 @@ class PubServer(BaseHTTPRequestHandler):
|
|||
if os.path.isfile(newswireFilename):
|
||||
os.remove(newswireFilename)
|
||||
|
||||
# save filtered words list for the newswire
|
||||
filterNewswireFilename = \
|
||||
baseDir + '/accounts/' + \
|
||||
'news@' + domain + '/filters.txt'
|
||||
if fields.get('filteredWordsNewswire'):
|
||||
with open(filterNewswireFilename, 'w+') as filterfile:
|
||||
filterfile.write(fields['filteredWordsNewswire'])
|
||||
else:
|
||||
if os.path.isfile(filterNewswireFilename):
|
||||
os.remove(filterNewswireFilename)
|
||||
|
||||
newswireTrustedFilename = baseDir + '/accounts/newswiretrusted.txt'
|
||||
if fields.get('trustedNewswire'):
|
||||
newswireTrusted = fields['trustedNewswire']
|
||||
|
|
|
@ -1345,6 +1345,22 @@ def htmlEditNewswire(translate: {}, baseDir: str, path: str,
|
|||
' <textarea id="message" name="editedNewswire" ' + \
|
||||
'style="height:500px">' + newswireStr + '</textarea>'
|
||||
|
||||
filterStr = ''
|
||||
filterFilename = \
|
||||
baseDir + '/accounts/news@' + domain + '/filters.txt'
|
||||
if os.path.isfile(filterFilename):
|
||||
with open(filterFilename, 'r') as filterfile:
|
||||
filterStr = filterfile.read()
|
||||
|
||||
editNewswireForm += \
|
||||
' <br><b><label class="labels">' + \
|
||||
translate['Filtered words'] + '</label></b>\n'
|
||||
editNewswireForm += ' <br><label class="labels">' + \
|
||||
translate['One per line'] + '</label>\n'
|
||||
editNewswireForm += ' <textarea id="message" ' + \
|
||||
'name="filteredWordsNewswire" style="height:200px">' + \
|
||||
filterStr + '</textarea>\n'
|
||||
|
||||
editNewswireForm += \
|
||||
'</div>'
|
||||
|
||||
|
|
Loading…
Reference in New Issue