Migrated `apply_whitelist()`

This commit is contained in:
slashtechno 2023-03-20 14:42:05 -04:00
parent 700d8ceafc
commit 2f64bbca27
Signed by: slashtechno
GPG Key ID: 8EC1D9D9286C2B17
1 changed files with 2 additions and 5 deletions

View File

@ -15,10 +15,7 @@ def get_blocklists():
return blocklists return blocklists
def apply_whitelists(blocklists): def apply_whitelists(blocklists):
for filename in os.listdir('./whitelists'): whitelist = utils.convert_to_list(pathlib.Path(__file__).parent.parent.joinpath('whitelist.txt'))
with open(os.path.join('./whitelists', filename), 'r') as f:
whitelist = f.readlines()
whitelist = [x.strip() for x in whitelist]
blocklists = [x for x in blocklists if x not in whitelist] blocklists = [x for x in blocklists if x not in whitelist]
return blocklists return blocklists