From 51d1c5e6e4fa0b73a0371172578366fee7b25ece Mon Sep 17 00:00:00 2001 From: Mo Langning <133737702+molangning@users.noreply.github.com> Date: Mon, 27 Nov 2023 23:31:57 +0800 Subject: [PATCH] changed script to be more modifiable --- .bin/swear-words-remover.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.bin/swear-words-remover.py b/.bin/swear-words-remover.py index b068f295..7906ef10 100755 --- a/.bin/swear-words-remover.py +++ b/.bin/swear-words-remover.py @@ -8,9 +8,9 @@ import os print("[+] Curse words remover") SOURCE_FOLDER="Miscellaneous/list-of-swear-words" +TARGET_DIRS=["Passwords/Common-Credentials"] curse_words=[] TARGET_SUFFIX="-without-curse-words" -target_dirs=[""] for root,_,file_list in os.walk(SOURCE_FOLDER): for file in file_list: @@ -21,10 +21,9 @@ for root,_,file_list in os.walk(SOURCE_FOLDER): # dedupe them curse_words=list(dict.fromkeys(curse_words)) -target_dirs=["Passwords/Common-Credentials"] target_files=[] -for i in target_dirs: +for i in TARGET_DIRS: for root,_,file_list in os.walk(i): for file in file_list: if not file.endswith(".txt"):