211
This commit is contained in:
@@ -296,7 +296,7 @@ class SemanticParser:
|
||||
if desc_match:
|
||||
lines = [re.sub(r"^\s*\*\s?", "", l).strip() for l in desc_match.group(1).strip().split('\n')]
|
||||
desc = " ".join(lines)
|
||||
relations = [m.groupdict() for m in re.finditer(r"[RELATION:\s*(?P<type>\w+)\s*target_id='(?P<target>.*?)']", body)]
|
||||
relations = [m.groupdict() for m in re.finditer(r"->\s*\[(?P<type>\w+)\]\s*->\s*\[\w+\('(?P<target>.*?)'\)\]", body)]
|
||||
return {"summary": summary, "description": desc, "relations": relations}
|
||||
# [END_ENTITY: Class('SemanticParser')]
|
||||
|
||||
@@ -454,7 +454,7 @@ def main():
|
||||
logger.info("[INFO][INITIALIZATION][configuring_logger] Логгер настроен. Уровень: %s", args.log_level)
|
||||
|
||||
output_report = {
|
||||
"status": "failure",
|
||||
"status": "success",
|
||||
"manifest_path": args.manifest_path,
|
||||
"files_scanned": len(args.files),
|
||||
"files_with_errors": 0,
|
||||
@@ -484,6 +484,7 @@ def main():
|
||||
except (FileNotFoundError, ValueError, ET.ParseError) as e:
|
||||
logger.critical("[FATAL][EXECUTION][critical_error] Критическая ошибка: %s", e, exc_info=True)
|
||||
output_report["error_message"] = str(e)
|
||||
output_report["status"] = "failure"
|
||||
|
||||
finally:
|
||||
print(json.dumps(output_report, indent=2, ensure_ascii=False))
|
||||
|
||||
Reference in New Issue
Block a user