Skip to content

Commit

Permalink
完善配置逻辑
Browse files Browse the repository at this point in the history
Amos Vstar authored and Amos Vstar committed Dec 15, 2024
1 parent fa8120e commit 3b6d63d
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions config.py
Original file line number Diff line number Diff line change
@@ -13,6 +13,7 @@ def __init__(self):

# manual
self.ls_index = 1
self.enable_trie_filtering = [True, False][0] # 是否按照 domain_suffix 剔除重复的 domain
self.ls_keyword = ["little-snitch", "adobe-blocklist"] # little snitch 链接关键字
self.map_dict = {
'DOMAIN-SUFFIX': 'domain_suffix', 'HOST-SUFFIX': 'domain_suffix', 'DOMAIN': 'domain', 'HOST': 'domain', 'host': 'domain',
4 changes: 2 additions & 2 deletions main.py
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@

class RuleParser:
def __init__(self):
self.ls_index = config.ls_index
self.ls_index = 1

def parse_littlesnitch_file(self, link):
"""
@@ -163,7 +163,7 @@ def generate_json_file(self, links, output_file):

return self.merge_json(json_file_list, output_file)

def merge_json(self, json_file_list, output_file, enable_trie_filtering=True):
def merge_json(self, json_file_list, output_file, enable_trie_filtering=config.enable_trie_filtering):
"""
合并 JSON 文件并进行去重(第二轮 Trie 去重为可选)。

0 comments on commit 3b6d63d

Please sign in to comment.