diff --git a/src/metadata_review_lib.py b/src/metadata_review_lib.py index 117247c..ebb4d22 100644 --- a/src/metadata_review_lib.py +++ b/src/metadata_review_lib.py @@ -194,7 +194,7 @@ def second_save_metadata_review(review_yaml_file_path, reviewer_attrs): -def third_update_hdf5_file_with_review(input_hdf5_file, yalm_review_file, reviewer_attrs = {}): +def third_update_hdf5_file_with_review(input_hdf5_file, yalm_review_file, reviewer_attrs = {}, hdf5_upload : bool = False): """Third""" # compare review file with current yalm file and then based on the changes open hdf5 file and access only @@ -275,12 +275,17 @@ def third_update_hdf5_file_with_review(input_hdf5_file, yalm_review_file, review status = subprocess.run(status_command,capture_output=True,check=True) + if hdf5_upload: + upload_ext = ['.h5','.yaml'] + else: + upload_ext = ['.yaml'] + files_to_add_list = [] for line in status.stdout.splitlines(): # conver line from bytes to str tmp = line.decode("utf-8") if 'modified' in tmp: - if any([ext in tmp for ext in ['.h5','.yaml']] ): + if any([ext in tmp for ext in upload_ext] ): files_to_add_list.append(tmp.split()[1]) if files_to_add_list: output = subprocess.run(add_command(files_to_add_list),capture_output=True,check=True)