Spaces:
Running
Running
File size: 661 Bytes
c410097 c43f64e c410097 c43f64e c410097 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | #!/usr/bin/env python
from __future__ import annotations
def load_ignore(file_path):
result_dict = {}
with open(file_path, 'r') as file:
for line in file:
line = line.strip()
if line:
line_without_trailing_comma = line.rstrip(',')
result_dict[line_without_trailing_comma] = True
return result_dict
ignore1 = load_ignore('ignoreTag.txt')
ignore_extra = load_ignore('ignoreTag2.txt')
ignore2 = ignore1.copy()
ignore2.update(ignore_extra)
def is_ignore(tag, ignore_type):
if ignore_type == 1:
return tag in ignore2
elif ignore_type == 2:
return tag in ignore1
|