Skip to content
Snippets Groups Projects
Commit d0f3534e authored by Julien (jvoisin) Voisin's avatar Julien (jvoisin) Voisin
Browse files

Hide unsupported extensions in `mat2 -l`

parent 8675706c
No related branches found
No related tags found
No related merge requests found
......@@ -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)
......
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment