summaryrefslogtreecommitdiff
path: root/libmat2/abstract.py
diff options
context:
space:
mode:
authorjvoisin2018-05-18 23:52:40 +0200
committerjvoisin2018-05-18 23:52:40 +0200
commit38fae60b8beaf9c7b37c65325d2d285e62b6cb85 (patch)
treee6bd4f699d6190dfada7618ebd04455eb7de9660 /libmat2/abstract.py
parent57d5cd04284276c49899034a9ad321b680624d8f (diff)
Rename some files to simplify packaging
- the `src` folder is now `libmat2` - the `main.py` script is now `mat2.py`
Diffstat (limited to 'libmat2/abstract.py')
-rw-r--r--libmat2/abstract.py24
1 files changed, 24 insertions, 0 deletions
diff --git a/libmat2/abstract.py b/libmat2/abstract.py
new file mode 100644
index 0000000..e4838a9
--- /dev/null
+++ b/libmat2/abstract.py
@@ -0,0 +1,24 @@
1import abc
2import os
3
4
5class AbstractParser(abc.ABC):
6 meta_list = set()
7 mimetypes = set()
8
9 def __init__(self, filename: str):
10 self.filename = filename
11 fname, extension = os.path.splitext(filename)
12 self.output_filename = fname + '.cleaned' + extension
13
14 @abc.abstractmethod
15 def get_meta(self) -> dict:
16 pass
17
18 @abc.abstractmethod
19 def remove_all(self) -> bool:
20 pass
21
22 def remove_all_lightweight(self) -> bool:
23 """ Remove _SOME_ metadata. """
24 return self.remove_all()