From 5b45478319c018c93f99b1c68ca6d6f11edcefb7 Mon Sep 17 00:00:00 2001 From: JSon Date: Mon, 26 Feb 2024 15:28:28 +0800 Subject: Change uses of whitelist to allowlist in translate_readme.py. Change uses of blacklist to blocklist in translate_readme.py. Change uses of blacklisted to blocklisted in translate_readme.py. --- etc/tool/translate_readme.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'etc/tool') diff --git a/etc/tool/translate_readme.py b/etc/tool/translate_readme.py index 43bfdcde..e0a9b1f1 100644 --- a/etc/tool/translate_readme.py +++ b/etc/tool/translate_readme.py @@ -18,12 +18,12 @@ Don't translate or change inline code examples. ```md """ keep_note = "Keep this: [!Note] as [!Note].\n" -blacklist = [ +blocklist = [ '## Šī¸ Copyright', '## 🚀 Providers and Models', '## 🔗 Related GPT4Free Projects' ] -whitelist = [ +allowlist = [ "### Other", "### Models" ] @@ -52,15 +52,15 @@ async def translate(text): return result async def translate_part(part, i): - blacklisted = False - for headline in blacklist: + blocklisted = False + for headline in blocklist: if headline in part: - blacklisted = True - if blacklisted: + blocklisted = True + if blocklisted: lines = part.split('\n') lines[0] = await translate(lines[0]) part = '\n'.join(lines) - for trans in whitelist: + for trans in allowlist: if trans in part: part = part.replace(trans, await translate(trans)) else: -- cgit v1.2.3