diff options
| author | jvoisin | 2018-07-06 00:42:09 +0200 |
|---|---|---|
| committer | jvoisin | 2018-07-06 00:42:09 +0200 |
| commit | 53271495f74bde7fde2329b7c5c938654a36b7dc (patch) | |
| tree | 1a4b73671b53b3da6a20694d77c54ef40cdecb72 /libmat2 | |
| parent | 0638b9bbbbe9fa5de50c01ea160a53f0e7162d59 (diff) | |
Add support for .txt files
Diffstat (limited to 'libmat2')
| -rw-r--r-- | libmat2/__init__.py | 2 | ||||
| -rw-r--r-- | libmat2/harmless.py | 7 |
2 files changed, 2 insertions, 7 deletions
diff --git a/libmat2/__init__.py b/libmat2/__init__.py index 91a51d8..190abe5 100644 --- a/libmat2/__init__.py +++ b/libmat2/__init__.py | |||
| @@ -12,8 +12,6 @@ unsupported_extensions = { | |||
| 12 | '.pot', | 12 | '.pot', |
| 13 | '.rdf', | 13 | '.rdf', |
| 14 | '.srt', | 14 | '.srt', |
| 15 | '.text', | ||
| 16 | '.txt', | ||
| 17 | '.wsdl', | 15 | '.wsdl', |
| 18 | '.xpdl', | 16 | '.xpdl', |
| 19 | '.xsd', | 17 | '.xsd', |
diff --git a/libmat2/harmless.py b/libmat2/harmless.py index 2878571..9032caf 100644 --- a/libmat2/harmless.py +++ b/libmat2/harmless.py | |||
| @@ -1,3 +1,4 @@ | |||
| 1 | import shutil | ||
| 1 | from typing import Dict | 2 | from typing import Dict |
| 2 | from . import abstract | 3 | from . import abstract |
| 3 | 4 | ||
| @@ -6,13 +7,9 @@ class HarmlessParser(abstract.AbstractParser): | |||
| 6 | """ This is the parser for filetypes that do not contain metadata. """ | 7 | """ This is the parser for filetypes that do not contain metadata. """ |
| 7 | mimetypes = {'text/plain', } | 8 | mimetypes = {'text/plain', } |
| 8 | 9 | ||
| 9 | def __init__(self, filename: str) -> None: | ||
| 10 | super().__init__(filename) | ||
| 11 | self.filename = filename | ||
| 12 | self.output_filename = filename | ||
| 13 | |||
| 14 | def get_meta(self) -> Dict[str, str]: | 10 | def get_meta(self) -> Dict[str, str]: |
| 15 | return dict() | 11 | return dict() |
| 16 | 12 | ||
| 17 | def remove_all(self) -> bool: | 13 | def remove_all(self) -> bool: |
| 14 | shutil.copy(self.filename, self.output_filename) | ||
| 18 | return True | 15 | return True |
