From 98fb7fe1f0edec16ecd405707cc903d2b4a7dc40 Mon Sep 17 00:00:00 2001 From: jvoisin Date: Mon, 28 Mar 2016 00:06:52 +0200 Subject: First step toward python3 --- libmat/strippers.py | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) (limited to 'libmat/strippers.py') 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 @@ """ Manage which fileformat can be processed """ -import archive -import mutagenstripper +from libmat.archive import TarStripper, Bzip2Stripper, GzipStripper, ZipStripper +from libmat import mutagenstripper, misc, office +from libmat.mat import LOGGING_LEVEL import logging -import mat -import misc -import office import subprocess STRIPPERS = { - 'application/x-tar': archive.TarStripper, - 'application/x-bzip2': archive.Bzip2Stripper, - 'application/x-gzip': archive.GzipStripper, - 'application/zip': archive.ZipStripper, + 'application/x-tar': TarStripper, + 'application/x-bzip2': Bzip2Stripper, + 'application/x-gzip': GzipStripper, + 'application/zip': ZipStripper, 'application/x-bittorrent': misc.TorrentStripper, 'application/torrent': misc.TorrentStripper, 'application/opendocument': office.OpenDocumentStripper, 'application/officeopenxml': office.OpenXmlStripper, } -logging.basicConfig(level=mat.LOGGING_LEVEL) +logging.basicConfig(level=LOGGING_LEVEL) # PDF support pdfSupport = True @@ -63,7 +61,7 @@ except ImportError: # exiftool try: subprocess.check_output(['exiftool', '-ver']) - import exiftool + from libmat import exiftool STRIPPERS['image/jpeg'] = exiftool.JpegStripper STRIPPERS['image/png'] = exiftool.PngStripper STRIPPERS['image/tiff'] = exiftool.TiffStripper -- cgit v1.3