scanner update
update DB
This commit is contained in:
@@ -13,18 +13,18 @@ def scan_in_file(filename):
|
||||
with open(filename, encoding='cp949') as file:
|
||||
code = file.read()
|
||||
|
||||
pattern = r"NODE_CLASS_MAPPINGS\s*=\s*{([^}]*)}"
|
||||
pattern = r"_CLASS_MAPPINGS\s*=\s*{([^}]*)}"
|
||||
regex = re.compile(pattern, re.MULTILINE | re.DOTALL)
|
||||
|
||||
nodes = set()
|
||||
class_dict = {}
|
||||
|
||||
pattern2 = r'NODE_CLASS_MAPPINGS\["(.*?)"\]'
|
||||
pattern2 = r'_CLASS_MAPPINGS\["(.*?)"\]'
|
||||
keys = re.findall(pattern2, code)
|
||||
for key in keys:
|
||||
nodes.add(key.strip())
|
||||
|
||||
pattern3 = r'NODE_CLASS_MAPPINGS\[\'(.*?)\'\]'
|
||||
pattern3 = r'_CLASS_MAPPINGS\[\'(.*?)\'\]'
|
||||
keys = re.findall(pattern3, code)
|
||||
for key in keys:
|
||||
nodes.add(key.strip())
|
||||
@@ -44,7 +44,7 @@ def scan_in_file(filename):
|
||||
for key, value in class_dict.items():
|
||||
nodes.add(key.strip())
|
||||
|
||||
update_pattern = r"NODE_CLASS_MAPPINGS.update\s*\({([^}]*)}\)"
|
||||
update_pattern = r"_CLASS_MAPPINGS.update\s*\({([^}]*)}\)"
|
||||
update_match = re.search(update_pattern, code)
|
||||
if update_match:
|
||||
update_dict_text = update_match.group(1)
|
||||
|
||||
Reference in New Issue
Block a user