File: harmless.py

package info (click to toggle)
mat2 0.14.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 12,376 kB
  • sloc: python: 3,772; makefile: 7
file content (15 lines) | stat: -rw-r--r-- 445 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import shutil
from typing import Union, Dict
from . import abstract


class HarmlessParser(abstract.AbstractParser):
    """ This is the parser for filetypes that can not contain metadata. """
    mimetypes = {'text/plain', 'image/x-ms-bmp', 'image/bmp'}

    def get_meta(self) -> Dict[str, Union[str, Dict]]:
        return dict()

    def remove_all(self) -> bool:
        shutil.copy(self.filename, self.output_filename)
        return True