Spaces:
Running
Running
| #!/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 | |