Skip to content

Commit

Permalink
fix typing errors
Browse files Browse the repository at this point in the history
  • Loading branch information
jjjermiah committed Jan 29, 2024
1 parent 1913844 commit ab50dac
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/nbiatoolkit/dicomsort/dicomsort.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,12 @@ def sortSingleDICOMFile(

os.makedirs(os.path.dirname(targetFilename), exist_ok=True)

match option:
case "copy":
shutil.copyfile(src=filePath, dst=targetFilename)
case "move":
shutil.move(src=filePath, dst=targetFilename)
if option == "copy":
shutil.copyfile(src=filePath, dst=targetFilename)
elif option == "move":
shutil.move(src=filePath, dst=targetFilename)
else:
raise ValueError(f"Invalid option: {option}")

return True

Expand All @@ -101,7 +102,7 @@ def sortDICOMFiles(self, option: str = "copy", overwrite: bool = False) -> bool:

return all(results)

def _get_dicom_files(self) -> list[str]:
def _get_dicom_files(self) -> 'list[str]':
dicom_file_paths = []
# Iterate over all files in the source directory
for root, dirs, files in os.walk(self.sourceDir):
Expand Down

0 comments on commit ab50dac

Please sign in to comment.