improve scanner.py

update DB
This commit is contained in:
Dr.Lt.Data
2023-07-31 20:19:10 +09:00
parent aa2ad3b0e4
commit 3377cd4a35
3 changed files with 77 additions and 3 deletions

View File

@@ -24,6 +24,11 @@ def scan_in_file(filename):
for key in keys:
nodes.add(key)
pattern3 = r'NODE_CLASS_MAPPINGS\[\'(.*?)\'\]'
keys = re.findall(pattern3, code)
for key in keys:
nodes.add(key)
matches = regex.findall(code)
for match in matches:
dict_text = match
@@ -32,6 +37,10 @@ def scan_in_file(filename):
for key, value in key_value_pairs:
class_dict[key] = value.strip()
key_value_pairs = re.findall(r"'([^']*)'\s*:\s*([^,\n]*)", dict_text)
for key, value in key_value_pairs:
class_dict[key] = value.strip()
for key, value in class_dict.items():
nodes.add(key)