Filtering of bio words with profile settings

merge-requests/30/head
Bob Mottram 2021-12-14 14:25:09 +00:00
parent 243a0a50fd
commit d21659d0ef
19 changed files with 62 additions and 18 deletions

View File

@ -6221,9 +6221,29 @@ class PubServer(BaseHTTPRequestHandler):
os.remove(filterFilename)
except OSError:
print('EX: _profileUpdate ' +
'unable to delete ' +
'unable to delete filter ' +
filterFilename)
# save filtered words within bio list
filterBioFilename = \
acctDir(baseDir, nickname, domain) + \
'/filters_bio.txt'
if fields.get('filteredWordsBio'):
try:
with open(filterBioFilename, 'w+') as filterfile:
filterfile.write(fields['filteredWordsBio'])
except OSError:
print('EX: unable to write bio filter ' +
filterBioFilename)
else:
if os.path.isfile(filterBioFilename):
try:
os.remove(filterBioFilename)
except OSError:
print('EX: _profileUpdate ' +
'unable to delete bio filter ' +
filterBioFilename)
# word replacements
switchFilename = \
acctDir(baseDir, nickname, domain) + \

View File

@ -501,5 +501,6 @@
"New link title and URL": "عنوان الارتباط الجديد وعنوان URL",
"Theme Designer": "مصمم المظهر",
"Reset": "إعادة ضبط",
"Encryption Keys": "مفاتيح التشفير"
"Encryption Keys": "مفاتيح التشفير",
"Filtered words within bio": "كلمات مفلترة داخل السيرة الذاتية"
}

View File

@ -501,5 +501,6 @@
"New link title and URL": "Títol i URL de l'enllaç nous",
"Theme Designer": "Dissenyador temàtic",
"Reset": "Restableix",
"Encryption Keys": "Claus de xifratge"
"Encryption Keys": "Claus de xifratge",
"Filtered words within bio": "Paraules filtrades dins de la biografia"
}

View File

@ -501,5 +501,6 @@
"New link title and URL": "Teitl dolen ac URL newydd",
"Theme Designer": "Dylunydd Thema",
"Reset": "Ail gychwyn",
"Encryption Keys": "Allweddi Amgryptio"
"Encryption Keys": "Allweddi Amgryptio",
"Filtered words within bio": "Geiriau wedi'u hidlo o fewn cofiant"
}

View File

@ -501,5 +501,6 @@
"New link title and URL": "Neuer Linktitel und URL",
"Theme Designer": "Themendesigner",
"Reset": "Zurücksetzen",
"Encryption Keys": "Verschlüsselungsschlüssel"
"Encryption Keys": "Verschlüsselungsschlüssel",
"Filtered words within bio": "Gefilterte Wörter in der Biografie"
}

View File

@ -501,5 +501,6 @@
"New link title and URL": "New link title and URL",
"Theme Designer": "Theme Designer",
"Reset": "Reset",
"Encryption Keys": "Encryption Keys"
"Encryption Keys": "Encryption Keys",
"Filtered words within bio": "Filtered words within bio"
}

View File

@ -501,5 +501,6 @@
"New link title and URL": "Nuevo título de enlace y URL",
"Theme Designer": "Diseñadora de temas",
"Reset": "Reiniciar",
"Encryption Keys": "Claves de cifrado"
"Encryption Keys": "Claves de cifrado",
"Filtered words within bio": "Palabras filtradas dentro de la biografía"
}

View File

@ -501,5 +501,6 @@
"New link title and URL": "Nouveau titre et URL du lien",
"Theme Designer": "Concepteur de thème",
"Reset": "Réinitialiser",
"Encryption Keys": "Clés de cryptage"
"Encryption Keys": "Clés de cryptage",
"Filtered words within bio": "Mots filtrés dans la biographie"
}

View File

@ -501,5 +501,6 @@
"New link title and URL": "Teideal nasc nua agus URL",
"Theme Designer": "Dearthóir Téama",
"Reset": "Athshocraigh",
"Encryption Keys": "Eochracha Criptithe"
"Encryption Keys": "Eochracha Criptithe",
"Filtered words within bio": "Focail scagtha laistigh den bheathaisnéis"
}

View File

@ -501,5 +501,6 @@
"New link title and URL": "नया लिंक शीर्षक और URL",
"Theme Designer": "थीम डिजाइनर",
"Reset": "रीसेट",
"Encryption Keys": "एन्क्रिप्शन कुंजी"
"Encryption Keys": "एन्क्रिप्शन कुंजी",
"Filtered words within bio": "जीवनी के भीतर फ़िल्टर किए गए शब्द"
}

View File

@ -501,5 +501,6 @@
"New link title and URL": "Nuovo titolo e URL del collegamento",
"Theme Designer": "Progettista di temi",
"Reset": "Ripristina",
"Encryption Keys": "Chiavi di crittografia"
"Encryption Keys": "Chiavi di crittografia",
"Filtered words within bio": "Parole filtrate all'interno della biografia"
}

View File

@ -501,5 +501,6 @@
"New link title and URL": "新しいリンクのタイトルとURL",
"Theme Designer": "テーマデザイナー",
"Reset": "リセット",
"Encryption Keys": "暗号化キー"
"Encryption Keys": "暗号化キー",
"Filtered words within bio": "伝記内のフィルタリングされた単語"
}

View File

@ -501,5 +501,6 @@
"New link title and URL": "Sernav û URL-ya girêdana nû",
"Theme Designer": "Theme Designer",
"Reset": "Reset",
"Encryption Keys": "Bişkojkên Şîfrekirinê"
"Encryption Keys": "Bişkojkên Şîfrekirinê",
"Filtered words within bio": "Peyvên fîlterkirî di hundurê biyografiyê de"
}

View File

@ -497,5 +497,6 @@
"New link title and URL": "New link title and URL",
"Theme Designer": "Theme Designer",
"Reset": "Reset",
"Encryption Keys": "Encryption Keys"
"Encryption Keys": "Encryption Keys",
"Filtered words within bio": "Filtered words within bio"
}

View File

@ -501,5 +501,6 @@
"New link title and URL": "Novo título e URL do link",
"Theme Designer": "Designer de Tema",
"Reset": "Redefinir",
"Encryption Keys": "Chaves de criptografia"
"Encryption Keys": "Chaves de criptografia",
"Filtered words within bio": "Palavras filtradas na biografia"
}

View File

@ -501,5 +501,6 @@
"New link title and URL": "Новое название ссылки и URL",
"Theme Designer": "Дизайнер тем",
"Reset": "Сброс настроек",
"Encryption Keys": "Ключи шифрования"
"Encryption Keys": "Ключи шифрования",
"Filtered words within bio": "Отфильтрованные слова в биографии"
}

View File

@ -501,5 +501,6 @@
"New link title and URL": "Kichwa kipya cha kiungo na URL",
"Theme Designer": "Mbuni wa Mandhari",
"Reset": "Weka upya",
"Encryption Keys": "Vifunguo vya Usimbaji"
"Encryption Keys": "Vifunguo vya Usimbaji",
"Filtered words within bio": "Maneno yaliyochujwa ndani ya wasifu"
}

View File

@ -501,5 +501,6 @@
"New link title and URL": "新链接标题和 URL",
"Theme Designer": "主题设计师",
"Reset": "重启",
"Encryption Keys": "加密密钥"
"Encryption Keys": "加密密钥",
"Filtered words within bio": "传记中的过滤词"
}

View File

@ -1700,6 +1700,13 @@ def _htmlEditProfileFiltering(baseDir: str, nickname: str, domain: str,
'name="filteredWords" style="height:200px" spellcheck="false">' + \
filterStr + '</textarea>\n' + \
' <br><b><label class="labels">' + \
translate['Filtered words within bio'] + '</label></b>\n' + \
' <br><label class="labels">' + \
translate['One per line'] + '</label>\n' + \
' <textarea id="message" ' + \
'name="filteredWordsBio" style="height:200px" spellcheck="false">' + \
filterStr + '</textarea>\n' + \
' <br><b><label class="labels">' + \
translate['Word Replacements'] + '</label></b>\n' + \
' <br><label class="labels">A -> B</label>\n' + \
' <textarea id="message" name="switchWords" ' + \