summaryrefslogtreecommitdiff
path: root/libmat/parser.py
diff options
context:
space:
mode:
Diffstat (limited to 'libmat/parser.py')
-rw-r--r--libmat/parser.py15
1 files changed, 11 insertions, 4 deletions
diff --git a/libmat/parser.py b/libmat/parser.py
index b81b576..f7a7ea2 100644
--- a/libmat/parser.py
+++ b/libmat/parser.py
@@ -6,8 +6,6 @@ import shutil
6import tempfile 6import tempfile
7 7
8 8
9import mat
10
11NOMETA = frozenset(( 9NOMETA = frozenset((
12 '.bmp', # "raw" image 10 '.bmp', # "raw" image
13 '.rdf', # text 11 '.rdf', # text
@@ -35,7 +33,15 @@ class GenericParser(object):
35 """ Remove tempfile if it was not used 33 """ Remove tempfile if it was not used
36 """ 34 """
37 if os.path.exists(self.output): 35 if os.path.exists(self.output):
38 mat.secure_remove(self.output) 36 from libmat.mat import secure_remove
37 secure_remove(self.output)
38
39 def get_meta(self):
40 """ Return a key-value representation of the file's metadata.
41
42 :ret dict key-value representation of the file's metadata.
43 """
44 raise NotImplementedError
39 45
40 def is_clean(self): 46 def is_clean(self):
41 """ 47 """
@@ -62,5 +68,6 @@ class GenericParser(object):
62 if self.backup: 68 if self.backup:
63 shutil.move(self.filename, os.path.join(self.filename, '.bak')) 69 shutil.move(self.filename, os.path.join(self.filename, '.bak'))
64 else: 70 else:
65 mat.secure_remove(self.filename) 71 from libmat.mat import secure_remove
72 secure_remove(self.filename)
66 shutil.move(self.output, self.filename) 73 shutil.move(self.output, self.filename)