From 2f64bbca27cf840c691e91a954c685c10a493c50 Mon Sep 17 00:00:00 2001 From: slashtechno <77907286+slashtechno@users.noreply.github.com> Date: Mon, 20 Mar 2023 14:42:05 -0400 Subject: [PATCH] Migrated `apply_whitelist()` --- zerotrust_adblock/adblock-zerotrust.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/zerotrust_adblock/adblock-zerotrust.py b/zerotrust_adblock/adblock-zerotrust.py index a8bf3ba..d03558d 100644 --- a/zerotrust_adblock/adblock-zerotrust.py +++ b/zerotrust_adblock/adblock-zerotrust.py @@ -15,12 +15,9 @@ def get_blocklists(): return blocklists def apply_whitelists(blocklists): - for filename in os.listdir('./whitelists'): - with open(os.path.join('./whitelists', filename), 'r') as f: - whitelist = f.readlines() - whitelist = [x.strip() for x in whitelist] + whitelist = utils.convert_to_list(pathlib.Path(__file__).parent.parent.joinpath('whitelist.txt')) blocklists = [x for x in blocklists if x not in whitelist] - return blocklists + return blocklists def split_list(blocklists): lists = []