1
0
mirror of synced 2024-11-22 09:14:23 +01:00
mat2/libmat2/harmless.py
jvoisin 09e748fa4c 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
2018-06-21 23:02:41 +02:00

19 lines
480 B
Python

from typing import Dict
from . import abstract
class HarmlessParser(abstract.AbstractParser):
""" This is the parser for filetypes that do not contain metadata. """
mimetypes = {'text/plain', }
def __init__(self, filename: str) -> None:
super().__init__(filename)
self.filename = filename
self.output_filename = filename
def get_meta(self) -> Dict[str, str]:
return dict()
def remove_all(self) -> bool:
return True