diff options
| author | jvoisin | 2011-06-23 19:00:44 +0200 |
|---|---|---|
| committer | jvoisin | 2011-06-23 19:00:44 +0200 |
| commit | e163520a130145496ceeeeeb94d950f17e7fd76e (patch) | |
| tree | 19d9bcfbc997f5884ea798f8edeaaad8da18915d /lib/mat.py | |
| parent | 9e69adbe1b065707f8be4f146cc3c05660cef711 (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.py | 10 |
1 files changed, 5 insertions, 5 deletions
| @@ -14,7 +14,7 @@ import hachoir_editor | |||
| 14 | import images | 14 | import images |
| 15 | import audio | 15 | import audio |
| 16 | import misc | 16 | import misc |
| 17 | import 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 | ||
| 30 | def create_class_file(name): | 30 | def 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) |
