File size: 620 Bytes
c410097
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/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')
ignore2 = load_ignore('ignoreTag2.txt')

def is_ignore(tag, ignore_type):
    if ignore_type == 1:
        return tag in ignore1 or tag in ignore2
    elif ignore_type == 2:
        return tag in ignore1