Skip to content

Commit

Permalink
addressing review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
akahles committed Nov 19, 2024
1 parent 169f07e commit 3e8d345
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions archiver/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down

0 comments on commit 3e8d345

Please sign in to comment.