From 01f8524cf70c77dacf6a3af305d257df6c030a7f Mon Sep 17 00:00:00 2001 From: Pradeeban Kathiravelu Date: Wed, 17 Mar 2021 16:42:34 -0400 Subject: [PATCH 1/2] Fix folder tree for delete files --- modules/meta-extraction/MetadataExtractor.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/modules/meta-extraction/MetadataExtractor.py b/modules/meta-extraction/MetadataExtractor.py index 9e9da01..32c4f99 100644 --- a/modules/meta-extraction/MetadataExtractor.py +++ b/modules/meta-extraction/MetadataExtractor.py @@ -225,8 +225,6 @@ def extract_metadata(): # Delete the processed DICOM objects from the storage. def clear_storage(): - os.chdir(STORAGE_FOLDER) - global processed_series_but_yet_to_delete global processed_and_deleted_series @@ -236,7 +234,7 @@ def clear_storage(): for del_series in processed_series_but_yet_to_delete: try: - shutil.rmtree(STORAGE_FOLDER + del_series) + shutil.rmtree(STORAGE_FOLDER + "/" + del_series) processed_and_deleted_series.append(del_series) processed_series_but_yet_to_delete.remove(del_series) From 07e6e4af93034b605f3617454e78f1d2fce332ab Mon Sep 17 00:00:00 2001 From: Pradeeban Kathiravelu Date: Wed, 17 Mar 2021 17:00:20 -0400 Subject: [PATCH 2/2] Fix previous commit --- modules/meta-extraction/MetadataExtractor.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/meta-extraction/MetadataExtractor.py b/modules/meta-extraction/MetadataExtractor.py index 32c4f99..448e839 100644 --- a/modules/meta-extraction/MetadataExtractor.py +++ b/modules/meta-extraction/MetadataExtractor.py @@ -225,6 +225,7 @@ def extract_metadata(): # Delete the processed DICOM objects from the storage. def clear_storage(): + os.chdir(STORAGE_FOLDER) global processed_series_but_yet_to_delete global processed_and_deleted_series @@ -234,7 +235,7 @@ def clear_storage(): for del_series in processed_series_but_yet_to_delete: try: - shutil.rmtree(STORAGE_FOLDER + "/" + del_series) + shutil.rmtree(del_series) processed_and_deleted_series.append(del_series) processed_series_but_yet_to_delete.remove(del_series)