diff options
| -rw-r--r-- | libmat2/abstract.py | 4 | ||||
| -rwxr-xr-x | mat2 | 4 |
2 files changed, 5 insertions, 3 deletions
diff --git a/libmat2/abstract.py b/libmat2/abstract.py index b7ccae9..7aac284 100644 --- a/libmat2/abstract.py +++ b/libmat2/abstract.py | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | import abc | 1 | import abc |
| 2 | import os | 2 | import os |
| 3 | from typing import Set | 3 | from typing import Set, Dict |
| 4 | 4 | ||
| 5 | assert Set # make pyflakes happy | 5 | assert Set # make pyflakes happy |
| 6 | 6 | ||
| @@ -15,7 +15,7 @@ class AbstractParser(abc.ABC): | |||
| 15 | self.output_filename = fname + '.cleaned' + extension | 15 | self.output_filename = fname + '.cleaned' + extension |
| 16 | 16 | ||
| 17 | @abc.abstractmethod | 17 | @abc.abstractmethod |
| 18 | def get_meta(self) -> dict: | 18 | def get_meta(self) -> Dict[str, str]: |
| 19 | pass | 19 | pass |
| 20 | 20 | ||
| 21 | @abc.abstractmethod | 21 | @abc.abstractmethod |
| @@ -72,6 +72,7 @@ def clean_meta(params: Tuple[str, bool]) -> bool: | |||
| 72 | 72 | ||
| 73 | def show_parsers(): | 73 | def show_parsers(): |
| 74 | print('[+] Supported formats:') | 74 | print('[+] Supported formats:') |
| 75 | formats = list() | ||
| 75 | for parser in parser_factory._get_parsers(): | 76 | for parser in parser_factory._get_parsers(): |
| 76 | for mtype in parser.mimetypes: | 77 | for mtype in parser.mimetypes: |
| 77 | extensions = set() | 78 | extensions = set() |
| @@ -82,7 +83,8 @@ def show_parsers(): | |||
| 82 | # we're not supporting a single extension in the current | 83 | # we're not supporting a single extension in the current |
| 83 | # mimetype, so there is not point in showing the mimetype at all | 84 | # mimetype, so there is not point in showing the mimetype at all |
| 84 | continue | 85 | continue |
| 85 | print(' - %s (%s)' % (mtype, ', '.join(extensions))) | 86 | formats.append(' - %s (%s)' % (mtype, ', '.join(extensions))) |
| 87 | print('\n'.join(sorted(formats))) | ||
| 86 | 88 | ||
| 87 | 89 | ||
| 88 | def __get_files_recursively(files): | 90 | def __get_files_recursively(files): |
