summaryrefslogtreecommitdiff
path: root/libmat/strippers.py
diff options
context:
space:
mode:
authorjvoisin2016-03-28 00:06:52 +0200
committerjvoisin2016-03-28 00:06:52 +0200
commit98fb7fe1f0edec16ecd405707cc903d2b4a7dc40 (patch)
treea4381c8f10d8d473a26ac878a27c67153d645373 /libmat/strippers.py
parente56992e8e0ef197974932cf3849f3e2fab7281df (diff)
First step toward python3
Diffstat (limited to 'libmat/strippers.py')
-rw-r--r--libmat/strippers.py20
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
4import archive 4from libmat.archive import TarStripper, Bzip2Stripper, GzipStripper, ZipStripper
5import mutagenstripper 5from libmat import mutagenstripper, misc, office
6from libmat.mat import LOGGING_LEVEL
6import logging 7import logging
7import mat
8import misc
9import office
10import subprocess 8import subprocess
11 9
12STRIPPERS = { 10STRIPPERS = {
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
23logging.basicConfig(level=mat.LOGGING_LEVEL) 21logging.basicConfig(level=LOGGING_LEVEL)
24 22
25# PDF support 23# PDF support
26pdfSupport = True 24pdfSupport = True
@@ -63,7 +61,7 @@ except ImportError:
63# exiftool 61# exiftool
64try: 62try:
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