1
0
Fork 0

Hide unsupported extensions in `mat2 -l`

This commit is contained in:
jvoisin 2018-10-05 12:42:51 +02:00
parent 8675706c93
commit d0f3534eff
2 changed files with 2 additions and 1 deletions

View File

@ -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)

2
mat2
View File

@ -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