From 3e8d3457f49a34cd211c6eaaea5ed384c7183b08 Mon Sep 17 00:00:00 2001 From: Andre Kahles Date: Tue, 19 Nov 2024 14:47:55 +0100 Subject: [PATCH] addressing review comments --- archiver/helpers.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/archiver/helpers.py b/archiver/helpers.py index dd5a410..f09c28a 100644 --- a/archiver/helpers.py +++ b/archiver/helpers.py @@ -339,18 +339,17 @@ def file_is_valid_archive_or_terminate(file_path): terminate_with_message(f"File {file_path.as_posix()} is not a valid archive of type {COMPRESSED_ARCHIVE_SUFFIX} or {ENCRYPTED_ARCHIVE_SUFFIX} or doesn't exist.") -def filename_without_archive_extensions(path): - """Removes every archiving suffix""" - return filepath_without_archive_extensions(path).name - - def filepath_without_archive_extensions(path:Path) -> Path: """Removes every archiving suffix""" while re.match(ARCHIVE_SUFFIXES_REG, path.suffix): path = path.with_suffix('') return path - return path.parent / path.name[:-len(suffixes_string)] + +def filename_without_archive_extensions(path): + """Removes every archiving suffix""" + return filepath_without_archive_extensions(path).name + def infer_source_name(source_path: Path) -> Path: