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/strippers.py | |
| parent | e56992e8e0ef197974932cf3849f3e2fab7281df (diff) | |
First step toward python3
Diffstat (limited to 'libmat/strippers.py')
| -rw-r--r-- | libmat/strippers.py | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/libmat/strippers.py b/libmat/strippers.py index 6a51aa8..2879375 100644 --- a/libmat/strippers.py +++ b/libmat/strippers.py | |||
| @@ -1,26 +1,24 @@ | |||
| 1 | """ Manage which fileformat can be processed | 1 | """ Manage which fileformat can be processed |
| 2 | """ | 2 | """ |
| 3 | 3 | ||
| 4 | import archive | 4 | from libmat.archive import TarStripper, Bzip2Stripper, GzipStripper, ZipStripper |
| 5 | import mutagenstripper | 5 | from libmat import mutagenstripper, misc, office |
| 6 | from libmat.mat import LOGGING_LEVEL | ||
| 6 | import logging | 7 | import logging |
| 7 | import mat | ||
| 8 | import misc | ||
| 9 | import office | ||
| 10 | import subprocess | 8 | import subprocess |
| 11 | 9 | ||
| 12 | STRIPPERS = { | 10 | STRIPPERS = { |
| 13 | 'application/x-tar': archive.TarStripper, | 11 | 'application/x-tar': TarStripper, |
| 14 | 'application/x-bzip2': archive.Bzip2Stripper, | 12 | 'application/x-bzip2': Bzip2Stripper, |
| 15 | 'application/x-gzip': archive.GzipStripper, | 13 | 'application/x-gzip': GzipStripper, |
| 16 | 'application/zip': archive.ZipStripper, | 14 | 'application/zip': ZipStripper, |
| 17 | 'application/x-bittorrent': misc.TorrentStripper, | 15 | 'application/x-bittorrent': misc.TorrentStripper, |
| 18 | 'application/torrent': misc.TorrentStripper, | 16 | 'application/torrent': misc.TorrentStripper, |
| 19 | 'application/opendocument': office.OpenDocumentStripper, | 17 | 'application/opendocument': office.OpenDocumentStripper, |
| 20 | 'application/officeopenxml': office.OpenXmlStripper, | 18 | 'application/officeopenxml': office.OpenXmlStripper, |
| 21 | } | 19 | } |
| 22 | 20 | ||
| 23 | logging.basicConfig(level=mat.LOGGING_LEVEL) | 21 | logging.basicConfig(level=LOGGING_LEVEL) |
| 24 | 22 | ||
| 25 | # PDF support | 23 | # PDF support |
| 26 | pdfSupport = True | 24 | pdfSupport = True |
| @@ -63,7 +61,7 @@ except ImportError: | |||
| 63 | # exiftool | 61 | # exiftool |
| 64 | try: | 62 | try: |
| 65 | subprocess.check_output(['exiftool', '-ver']) | 63 | subprocess.check_output(['exiftool', '-ver']) |
| 66 | import exiftool | 64 | from libmat import exiftool |
| 67 | STRIPPERS['image/jpeg'] = exiftool.JpegStripper | 65 | STRIPPERS['image/jpeg'] = exiftool.JpegStripper |
| 68 | STRIPPERS['image/png'] = exiftool.PngStripper | 66 | STRIPPERS['image/png'] = exiftool.PngStripper |
| 69 | STRIPPERS['image/tiff'] = exiftool.TiffStripper | 67 | STRIPPERS['image/tiff'] = exiftool.TiffStripper |
