/usr/share/pyshared/MAT/strippers.py is in mat 0.4.2-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 | ''' Manage which fileformat can be processed
'''
import archive
import audio
import gi
import images
import logging
import mat
import misc
import office
import subprocess
STRIPPERS = {
'application/x-tar': archive.TarStripper,
'application/x-bzip2': archive.Bzip2Stripper,
'application/zip': archive.ZipStripper,
'audio/mpeg': audio.MpegAudioStripper,
'application/x-bittorrent': misc.TorrentStripper,
'application/opendocument': office.OpenDocumentStripper,
'application/officeopenxml': office.OpenXmlStripper,
}
logging.basicConfig(level=mat.LOGGING_LEVEL)
# PDF support
pdfSupport = True
try:
from gi.repository import Poppler
except ImportError:
logging.info('Unable to import Poppler: no PDF support')
pdfSupport = False
try:
import cairo
except ImportError:
logging.info('Unable to import python-cairo: no PDF support')
pdfSupport = False
try:
import pdfrw
except ImportError:
logging.info('Unable to import python-pdfrw: no PDf support')
pdfSupport = False
if pdfSupport:
STRIPPERS['application/x-pdf'] = office.PdfStripper
STRIPPERS['application/pdf'] = office.PdfStripper
# audio format support with mutagen-python
try:
import mutagen
STRIPPERS['audio/x-flac'] = audio.FlacStripper
STRIPPERS['audio/vorbis'] = audio.OggStripper
STRIPPERS['audio/mpeg'] = audio.MpegAudioStripper
except ImportError:
logging.info('Unable to import python-mutagen: limited audio format support')
# exiftool
try:
subprocess.check_output(['exiftool', '-ver'])
import exiftool
STRIPPERS['image/jpeg'] = exiftool.JpegStripper
STRIPPERS['image/png'] = exiftool.PngStripper
except OSError: # if exiftool is not installed, use hachoir instead
logging.info('Unable to find exiftool: limited images support')
STRIPPERS['image/jpeg'] = images.JpegStripper
STRIPPERS['image/png'] = images.PngStripper
|