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

Sort the output of `mat2 -l`

parent 6a1b0b31
No related branches found
No related tags found
No related merge requests found
import abc
import os
from typing import Set
from typing import Set, Dict
assert Set # make pyflakes happy
......@@ -15,7 +15,7 @@ class AbstractParser(abc.ABC):
self.output_filename = fname + '.cleaned' + extension
@abc.abstractmethod
def get_meta(self) -> dict:
def get_meta(self) -> Dict[str, str]:
pass
@abc.abstractmethod
......
......@@ -72,6 +72,7 @@ def clean_meta(params: Tuple[str, bool]) -> bool:
def show_parsers():
print('[+] Supported formats:')
formats = list()
for parser in parser_factory._get_parsers():
for mtype in parser.mimetypes:
extensions = set()
......@@ -82,7 +83,8 @@ def show_parsers():
# we're not supporting a single extension in the current
# mimetype, so there is not point in showing the mimetype at all
continue
print(' - %s (%s)' % (mtype, ', '.join(extensions)))
formats.append(' - %s (%s)' % (mtype, ', '.join(extensions)))
print('\n'.join(sorted(formats)))
def __get_files_recursively(files):
......
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