diff options
| author | jvoisin | 2019-04-27 06:03:09 -0700 |
|---|---|---|
| committer | jvoisin | 2019-04-27 06:03:09 -0700 |
| commit | 8e41b098d6a8eb8da5687824a59c3af07b18725b (patch) | |
| tree | 0b2e74eaa9d4c77cb3d93965897978c995f4c3b5 /libmat2/abstract.py | |
| parent | 82cc822a1dc7090f7a6af977ed6d4b7b945d038a (diff) | |
Add support for compressed tar files
Diffstat (limited to 'libmat2/abstract.py')
| -rw-r--r-- | libmat2/abstract.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libmat2/abstract.py b/libmat2/abstract.py index aaf00d7..a7c5fa5 100644 --- a/libmat2/abstract.py +++ b/libmat2/abstract.py | |||
| @@ -25,6 +25,11 @@ class AbstractParser(abc.ABC): | |||
| 25 | 25 | ||
| 26 | self.filename = filename | 26 | self.filename = filename |
| 27 | fname, extension = os.path.splitext(filename) | 27 | fname, extension = os.path.splitext(filename) |
| 28 | |||
| 29 | # Special case for tar.gz, tar.bz2, … files | ||
| 30 | if fname.endswith('.tar') and len(fname) > 4: | ||
| 31 | fname, extension = fname[:-4], '.tar' + extension | ||
| 32 | |||
| 28 | self.output_filename = fname + '.cleaned' + extension | 33 | self.output_filename = fname + '.cleaned' + extension |
| 29 | self.lightweight_cleaning = False | 34 | self.lightweight_cleaning = False |
| 30 | 35 | ||
