From 4c81e731a485d3ea84049ef6d568153c8b10e90b Mon Sep 17 00:00:00 2001 From: jvoisin Date: Sun, 27 Oct 2013 23:01:20 +0000 Subject: Improves documentation --- MAT/parser.py | 33 +++++++++++++++------------------ 1 file changed, 15 insertions(+), 18 deletions(-) (limited to 'MAT/parser.py') 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 @@ +''' Parent class of all parser ''' - Parent class of all parser -''' - -import hachoir_core -import hachoir_editor import os -import tempfile import shutil +import tempfile + +import hachoir_core +import hachoir_editor import mat -NOMETA = frozenset(('.bmp', # image - '.rdf', # text - '.txt', # plain text - '.xml', # formated text (XML) - '.rels', # openXML formated text - )) +NOMETA = frozenset(( + '.bmp', # "raw" image + '.rdf', # text + '.txt', # plain text + '.xml', # formated text (XML) + '.rels', # openXML formated text +)) FIELD = object() @@ -92,8 +92,7 @@ class GenericParser(object): del fieldset[field] def get_meta(self): - ''' - Return a dict with all the meta of the file + ''' Return a dict with all the meta of the file ''' metadata = {} self._get_meta(self.editor, metadata) @@ -113,8 +112,7 @@ class GenericParser(object): self._get_meta(field, None) def _should_remove(self, key): - ''' - Return True if the field is compromising + ''' Return True if the field is compromising abstract method ''' raise NotImplementedError @@ -125,8 +123,7 @@ class GenericParser(object): shutil.copy2(self.filename, self.filename + '.bak') def do_backup(self): - ''' - Keep a backup of the file if asked. + ''' Keep a backup of the file if asked. The process of double-renaming is not very elegant, but it greatly simplify new strippers implementation. -- cgit v1.3