1
0
mirror of synced 2024-11-11 20:08:52 +01:00
mat2/libmat2/abstract.py
2018-06-04 23:32:13 +02:00

28 lines
667 B
Python

import abc
import os
from typing import Set, Dict
assert Set # make pyflakes happy
class AbstractParser(abc.ABC):
meta_list = set() # type: Set[str]
mimetypes = set() # type: Set[str]
def __init__(self, filename: str) -> None:
self.filename = filename
fname, extension = os.path.splitext(filename)
self.output_filename = fname + '.cleaned' + extension
@abc.abstractmethod
def get_meta(self) -> Dict[str, str]:
pass
@abc.abstractmethod
def remove_all(self) -> bool:
pass
def remove_all_lightweight(self) -> bool:
""" Remove _SOME_ metadata. """
return self.remove_all()