diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..60ce4b66d28d3f142abee00425cc53e98dc572f9 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +\.DS_Store diff --git a/validation/validate-mmcif-file.py b/validation/validate-mmcif-file.py index 3eaa64e1fdf1cb1925f4aaf6ebeeb2788f780cb4..dff916fad0bf0201fde273e21581f77b340ed4e9 100755 --- a/validation/validate-mmcif-file.py +++ b/validation/validate-mmcif-file.py @@ -423,16 +423,16 @@ class _CifCheck: universal_newlines=True, cwd=cifcheck_wd, ) + error_lst = [] # get error messages on the command line - filename = os.path.basename(filepath) - if cps.returncode != 0: - error_lst = _parse_cifcheck_stderr(cps.stderr) - error_lst.extend(_parse_parser_file(filename)) + error_lst.extend(_parse_cifcheck_stderr(cps.stderr)) + error_lst.extend(_parse_parser_file(filepath)) + if len(error_lst) > 0: raise _CifCheckFailedError(cifcheck_cmd, error_lst) # get messages from diagnosis file - error_lst.extend(_parse_diag_file(os.path.join(cifcheck_wd, filename))) + error_lst.extend(_parse_diag_file(filepath)) return error_lst @@ -625,12 +625,6 @@ def _main(): cifcheck.make_json_output() sys.exit(1) - # do a first check of the model cif alone to make sure its actual cif - success = cifcheck.run(opts.model_cif) - if not success: - cifcheck.make_json_output() - sys.exit(1) - # check for associated files referenced by the model cif file assoc_files, model_cif_data, entry_id_map = _get_associated_files( opts.model_cif @@ -641,12 +635,6 @@ def _main(): # make sure associated files exist and merge all of them into the model for assoc, entry_id in assoc_files: assoc_path = os.path.join(opts.associates_dir, assoc) - # CifCheck the file to make sure its actually cif, diagnosis messages do - # not matter at this point as an incomplete file is tested. - success = cifcheck.run(assoc_path) - if not success: - cifcheck.make_json_output() - sys.exit(1) # merge the model.cif and the associated file msgs = _merge_cif_data( model_cif_data, assoc_path, entry_id, entry_id_map