mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-27 05:35:49 -04:00
removes rng files after use and prints more information if XML file does not conform to RelaxNG
This commit is contained in:
parent
4fc764f5b3
commit
9060d420fa
1 changed files with 7 additions and 2 deletions
|
|
@ -79,10 +79,15 @@ for xml_file in xml_files:
|
|||
relaxng = etree.RelaxNG(relaxng_doc)
|
||||
|
||||
# validate xml file again RelaxNG
|
||||
if relaxng.validate(xml_tree):
|
||||
try:
|
||||
relaxng.assertValid(xml_tree)
|
||||
print(BOLD + OK + '[VALID]' + ENDC)
|
||||
else:
|
||||
except etree.DocumentInvalid as e:
|
||||
print(BOLD + FAIL + '[NOT VALID]' + ENDC)
|
||||
print(" {0}".format(e))
|
||||
|
||||
# remove rng file
|
||||
os.remove(rng_file)
|
||||
|
||||
# trang command failed
|
||||
else:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue