From 6b494d3f2a3f0370554c68f4225d4eb69d16a06c Mon Sep 17 00:00:00 2001 From: Lester Hedges Date: Mon, 24 Aug 2026 09:12:28 +0100 Subject: [PATCH] Match tar files by extension. [closes #547] --- src/BioSimSpace/Gateway/_requirements.py | 8 ++++---- .../Sandpit/Exscientia/Gateway/_requirements.py | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/BioSimSpace/Gateway/_requirements.py b/src/BioSimSpace/Gateway/_requirements.py index 0ca478fb0..fe6c1b850 100644 --- a/src/BioSimSpace/Gateway/_requirements.py +++ b/src/BioSimSpace/Gateway/_requirements.py @@ -2037,13 +2037,13 @@ def _unarchive(name): else: dir = _os.path.splitext(name)[0] + "/" - # List of supported tar file formats. - tarfiles = ["tar.gz", "tar.bz2", "tar"] + # List of supported tar file extensions. + tar_exts = [".tar.gz", ".tar.bz2", ".tar"] # Check whether this is a tar compressed file. - for tar_name in tarfiles: + for ext in tar_exts: # Found a match. - if tar_name in name.lower(): + if name.lower().endswith(ext): # The list of decompressed files. files = [] diff --git a/src/BioSimSpace/Sandpit/Exscientia/Gateway/_requirements.py b/src/BioSimSpace/Sandpit/Exscientia/Gateway/_requirements.py index 0ca478fb0..fe6c1b850 100644 --- a/src/BioSimSpace/Sandpit/Exscientia/Gateway/_requirements.py +++ b/src/BioSimSpace/Sandpit/Exscientia/Gateway/_requirements.py @@ -2037,13 +2037,13 @@ def _unarchive(name): else: dir = _os.path.splitext(name)[0] + "/" - # List of supported tar file formats. - tarfiles = ["tar.gz", "tar.bz2", "tar"] + # List of supported tar file extensions. + tar_exts = [".tar.gz", ".tar.bz2", ".tar"] # Check whether this is a tar compressed file. - for tar_name in tarfiles: + for ext in tar_exts: # Found a match. - if tar_name in name.lower(): + if name.lower().endswith(ext): # The list of decompressed files. files = []