summaryrefslogtreecommitdiff
path: root/MAT/parser.py
diff options
context:
space:
mode:
authorjvoisin2013-10-27 23:01:20 +0000
committerjvoisin2013-10-27 23:01:20 +0000
commit4c81e731a485d3ea84049ef6d568153c8b10e90b (patch)
tree86ad43d7df67ed8d27cfbe7ff60dda1545784845 /MAT/parser.py
parent6f21743fdae533d7a94f64fb03d706fb342aff01 (diff)
Improves documentation
Diffstat (limited to 'MAT/parser.py')
-rw-r--r--MAT/parser.py33
1 files changed, 15 insertions, 18 deletions
diff --git a/MAT/parser.py b/MAT/parser.py
index c1c3f4c..ae07d7e 100644
--- a/MAT/parser.py
+++ b/MAT/parser.py
@@ -1,22 +1,22 @@
1''' Parent class of all parser
1''' 2'''
2 Parent class of all parser
3'''
4
5import hachoir_core
6import hachoir_editor
7 3
8import os 4import os
9import tempfile
10import shutil 5import shutil
6import tempfile
7
8import hachoir_core
9import hachoir_editor
11 10
12import mat 11import mat
13 12
14NOMETA = frozenset(('.bmp', # image 13NOMETA = frozenset((
15 '.rdf', # text 14 '.bmp', # "raw" image
16 '.txt', # plain text 15 '.rdf', # text
17 '.xml', # formated text (XML) 16 '.txt', # plain text
18 '.rels', # openXML formated text 17 '.xml', # formated text (XML)
19 )) 18 '.rels', # openXML formated text
19))
20 20
21FIELD = object() 21FIELD = object()
22 22
@@ -92,8 +92,7 @@ class GenericParser(object):
92 del fieldset[field] 92 del fieldset[field]
93 93
94 def get_meta(self): 94 def get_meta(self):
95 ''' 95 ''' Return a dict with all the meta of the file
96 Return a dict with all the meta of the file
97 ''' 96 '''
98 metadata = {} 97 metadata = {}
99 self._get_meta(self.editor, metadata) 98 self._get_meta(self.editor, metadata)
@@ -113,8 +112,7 @@ class GenericParser(object):
113 self._get_meta(field, None) 112 self._get_meta(field, None)
114 113
115 def _should_remove(self, key): 114 def _should_remove(self, key):
116 ''' 115 ''' Return True if the field is compromising
117 Return True if the field is compromising
118 abstract method 116 abstract method
119 ''' 117 '''
120 raise NotImplementedError 118 raise NotImplementedError
@@ -125,8 +123,7 @@ class GenericParser(object):
125 shutil.copy2(self.filename, self.filename + '.bak') 123 shutil.copy2(self.filename, self.filename + '.bak')
126 124
127 def do_backup(self): 125 def do_backup(self):
128 ''' 126 ''' Keep a backup of the file if asked.
129 Keep a backup of the file if asked.
130 127
131 The process of double-renaming is not very elegant, 128 The process of double-renaming is not very elegant,
132 but it greatly simplify new strippers implementation. 129 but it greatly simplify new strippers implementation.