diff --git a/libmat2/parser_factory.py b/libmat2/parser_factory.py index 8bca081..621640b 100644 --- a/libmat2/parser_factory.py +++ b/libmat2/parser_factory.py @@ -33,6 +33,7 @@ def _get_parsers() -> List[T]: def get_parser(filename: str) -> Tuple[Optional[T], Optional[str]]: + """ Return the appropriate parser for a giver filename. """ mtype, _ = mimetypes.guess_type(filename) _, extension = os.path.splitext(filename) diff --git a/mat2 b/mat2 index a49b110..6c23836 100755 --- a/mat2 +++ b/mat2 @@ -96,7 +96,7 @@ def show_parsers(): for mtype in parser.mimetypes: extensions = set() for extension in mimetypes.guess_all_extensions(mtype): - if extension[1:] not in UNSUPPORTED_EXTENSIONS: # skip the dot + if extension not in UNSUPPORTED_EXTENSIONS: extensions.add(extension) if not extensions: # we're not supporting a single extension in the current