Skip to content
Snippets Groups Projects
Commit 7c006c4a authored by Bienchen's avatar Bienchen
Browse files

Add 'errors' to report

parent 94deb4c5
Branches
No related tags found
No related merge requests found
......@@ -709,13 +709,6 @@ class _CifCheck:
Be aware, that cuts away the majority of the messages. But solving those
issues first, may already repair a mmCIF file."""
not_implemented = ["errors"]
for category in not_implemented:
if len(self.check_results[category]) > 0:
raise NotImplementedError(
f"Results for category '{category}' not yet supported in "
+ "report."
)
print("Report")
print("======")
print(f"Status of check: {self.check_results['status']}")
......@@ -814,6 +807,30 @@ class _CifCheck:
for line in sorted(rprt["parchild_mm"]):
print(f" {line}")
# condense 'other' errors
rprt = {
"missing_files": {},
}
for line in self.check_results["errors"]:
match = re.match(r"ma_entry_associated_files.file_url '(?P<arc>.*)' is missing ma_associated_archive_file_details.file_path '(?P<fle>.*)'", line)
if match is not None:
try:
rprt["missing_files"][match.group('arc')].append(match.group('fle'))
except KeyError:
rprt["missing_files"][match.group('arc')] = [match.group('fle')]
continue
# Unmatched lines need to be added to above evaluation
raise RuntimeError(f'Unmatched error line found:\n"""{line}"""')
# print above evaluation in the report
print("Other issues:")
if len(rprt["missing_files"]) > 0:
print(" Missing (archive) )files:")
for arc, fles in rprt["missing_files"].items():
print(f" {arc}:")
for line in fles:
print(f" {line}")
# print erros/ messages caught
print("Errors by running CifCheck:")
for line in self.check_results["cifcheck-errors"]:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment