scanner update

update DB
This commit is contained in:
dr.lt.data
2023-09-01 10:49:45 +09:00
parent 9b535f163c
commit 62650a46a1
5 changed files with 132 additions and 6 deletions

View File

@@ -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)