diff options
| author | jvoisin | 2018-06-21 23:02:41 +0200 |
|---|---|---|
| committer | jvoisin | 2018-06-21 23:02:41 +0200 |
| commit | 09e748fa4c1785ba8a21ccac13bb693555d6c57b (patch) | |
| tree | ff86ed14a98b4eda25c82ae1ea8c6fed0a550293 /libmat2/harmless.py | |
| parent | a89dae054a23123017f6070dea6713fd5dc88ce1 (diff) | |
Refactor how offices files are handled
- xml files are no longer considered harmless
- Factorization of the `remove_all` method for office files
- Explicit whitelist are used
- Blacklist are used to skip files completely
- Non-blacklisted files are _still cleaned_
- Unsupported files are still triggering an error
Diffstat (limited to 'libmat2/harmless.py')
| -rw-r--r-- | libmat2/harmless.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libmat2/harmless.py b/libmat2/harmless.py index 54737a8..2878571 100644 --- a/libmat2/harmless.py +++ b/libmat2/harmless.py | |||
| @@ -4,7 +4,7 @@ from . import abstract | |||
| 4 | 4 | ||
| 5 | class HarmlessParser(abstract.AbstractParser): | 5 | class HarmlessParser(abstract.AbstractParser): |
| 6 | """ This is the parser for filetypes that do not contain metadata. """ | 6 | """ This is the parser for filetypes that do not contain metadata. """ |
| 7 | mimetypes = {'application/xml', 'text/plain', 'text/xml', 'application/rdf+xml'} | 7 | mimetypes = {'text/plain', } |
| 8 | 8 | ||
| 9 | def __init__(self, filename: str) -> None: | 9 | def __init__(self, filename: str) -> None: |
| 10 | super().__init__(filename) | 10 | super().__init__(filename) |
