diff options
| author | jvoisin | 2016-03-28 00:06:52 +0200 |
|---|---|---|
| committer | jvoisin | 2016-03-28 00:06:52 +0200 |
| commit | 98fb7fe1f0edec16ecd405707cc903d2b4a7dc40 (patch) | |
| tree | a4381c8f10d8d473a26ac878a27c67153d645373 /libmat/parser.py | |
| parent | e56992e8e0ef197974932cf3849f3e2fab7281df (diff) | |
First step toward python3
Diffstat (limited to 'libmat/parser.py')
| -rw-r--r-- | libmat/parser.py | 15 |
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 | |||
| 6 | import tempfile | 6 | import tempfile |
| 7 | 7 | ||
| 8 | 8 | ||
| 9 | import mat | ||
| 10 | |||
| 11 | NOMETA = frozenset(( | 9 | NOMETA = 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) |
