1
0
mirror of synced 2024-11-11 11:58:51 +01:00
mat2/libmat2/harmless.py

16 lines
445 B
Python
Raw Normal View History

2018-07-06 00:42:09 +02:00
import shutil
2023-01-28 16:57:20 +01:00
from typing import Union, Dict
2018-03-31 15:46:50 +02:00
from . import abstract
2018-03-31 15:46:50 +02:00
class HarmlessParser(abstract.AbstractParser):
2018-07-19 23:10:27 +02:00
""" This is the parser for filetypes that can not contain metadata. """
2023-07-11 21:35:04 +02:00
mimetypes = {'text/plain', 'image/x-ms-bmp', 'image/bmp'}
2018-03-31 15:46:50 +02:00
2023-01-28 16:57:20 +01:00
def get_meta(self) -> Dict[str, Union[str, Dict]]:
2018-03-31 15:46:50 +02:00
return dict()
2018-06-04 22:54:01 +02:00
def remove_all(self) -> bool:
2018-07-06 00:42:09 +02:00
shutil.copy(self.filename, self.output_filename)
2018-03-31 15:46:50 +02:00
return True