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/parser_factory.py | |
| parent | 82cc822a1dc7090f7a6af977ed6d4b7b945d038a (diff) | |
Add support for compressed tar files
Diffstat (limited to 'libmat2/parser_factory.py')
| -rw-r--r-- | libmat2/parser_factory.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libmat2/parser_factory.py b/libmat2/parser_factory.py index e93ee4f..3931903 100644 --- a/libmat2/parser_factory.py +++ b/libmat2/parser_factory.py | |||
| @@ -50,6 +50,10 @@ def get_parser(filename: str) -> Tuple[Optional[T], Optional[str]]: | |||
| 50 | if extension.lower() in UNSUPPORTED_EXTENSIONS: | 50 | if extension.lower() in UNSUPPORTED_EXTENSIONS: |
| 51 | return None, mtype | 51 | return None, mtype |
| 52 | 52 | ||
| 53 | if mtype == 'application/x-tar': | ||
| 54 | if extension[1:] in ('bz2', 'gz', 'xz'): | ||
| 55 | mtype = mtype + '+' + extension[1:] | ||
| 56 | |||
| 53 | for parser_class in _get_parsers(): # type: ignore | 57 | for parser_class in _get_parsers(): # type: ignore |
| 54 | if mtype in parser_class.mimetypes: | 58 | if mtype in parser_class.mimetypes: |
| 55 | try: | 59 | try: |
