From 98fb7fe1f0edec16ecd405707cc903d2b4a7dc40 Mon Sep 17 00:00:00 2001 From: jvoisin Date: Mon, 28 Mar 2016 00:06:52 +0200 Subject: First step toward python3 --- libmat/parser.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'libmat/parser.py') 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 import tempfile -import mat - NOMETA = frozenset(( '.bmp', # "raw" image '.rdf', # text @@ -35,7 +33,15 @@ class GenericParser(object): """ Remove tempfile if it was not used """ if os.path.exists(self.output): - mat.secure_remove(self.output) + from libmat.mat import secure_remove + secure_remove(self.output) + + def get_meta(self): + """ Return a key-value representation of the file's metadata. + + :ret dict key-value representation of the file's metadata. + """ + raise NotImplementedError def is_clean(self): """ @@ -62,5 +68,6 @@ class GenericParser(object): if self.backup: shutil.move(self.filename, os.path.join(self.filename, '.bak')) else: - mat.secure_remove(self.filename) + from libmat.mat import secure_remove + secure_remove(self.filename) shutil.move(self.output, self.filename) -- cgit v1.3