summaryrefslogtreecommitdiff
path: root/lib/mat.py
diff options
context:
space:
mode:
authorjvoisin2011-06-23 19:00:44 +0200
committerjvoisin2011-06-23 19:00:44 +0200
commite163520a130145496ceeeeeb94d950f17e7fd76e (patch)
tree19d9bcfbc997f5884ea798f8edeaaad8da18915d /lib/mat.py
parent9e69adbe1b065707f8be4f146cc3c05660cef711 (diff)
Implementation of the --backup option, to keep a backup of the treated file (disabled by default)
Diffstat (limited to 'lib/mat.py')
-rw-r--r--lib/mat.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/mat.py b/lib/mat.py
index a9b8e17..6abcd64 100644
--- a/lib/mat.py
+++ b/lib/mat.py
@@ -14,7 +14,7 @@ import hachoir_editor
14import images 14import images
15import audio 15import audio
16import misc 16import misc
17import archive 17#import archive
18 18
19__version__ = "0.1" 19__version__ = "0.1"
20__author__ = "jvoisin" 20__author__ = "jvoisin"
@@ -24,10 +24,10 @@ strippers = {
24 hachoir_parser.image.PngFile: images.PngStripper, 24 hachoir_parser.image.PngFile: images.PngStripper,
25 hachoir_parser.audio.MpegAudioFile: audio.MpegAudioStripper, 25 hachoir_parser.audio.MpegAudioFile: audio.MpegAudioStripper,
26 hachoir_parser.misc.PDFDocument: misc.PdfStripper, 26 hachoir_parser.misc.PDFDocument: misc.PdfStripper,
27 hachoir_parser.archive.TarFile: archive.TarStripper, 27 #hachoir_parser.archive.TarFile: archive.TarStripper,
28} 28}
29 29
30def create_class_file(name): 30def create_class_file(name, backup):
31 ''' 31 '''
32 return a $FILETYPEStripper() class, 32 return a $FILETYPEStripper() class,
33 corresponding to the filetype of the given file 33 corresponding to the filetype of the given file
@@ -57,5 +57,5 @@ def create_class_file(name):
57 print("Don't have stripper for file type: %s" % editor.description) 57 print("Don't have stripper for file type: %s" % editor.description)
58 sys.exit(1) 58 sys.exit(1)
59 if editor.input.__class__ == hachoir_parser.misc.PDFDocument: 59 if editor.input.__class__ == hachoir_parser.misc.PDFDocument:
60 return stripper_class(filename) 60 return stripper_class(filename, backup)
61 return stripper_class(realname, filename, parser, editor) 61 return stripper_class(realname, filename, parser, editor, backup)