summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjvoisin2011-11-18 00:54:46 +0100
committerjvoisin2011-11-18 00:54:46 +0100
commitf7653c3fba09ff06a87125d6f20c24368a21bf63 (patch)
treea0f7bb9d023c7f33b432031143853fae42a0c692
parent7e43701c21b04338ce3c44f5d1ea918fa4315047 (diff)
parentf0e8e2d894ae4fcc6e0f87741dfb8511f52fc0c1 (diff)
Merge branch 'master' of git://git.torproject.org/user/jvoisin/mat
-rwxr-xr-xmat-cli2
-rw-r--r--mat/exiftool.py4
-rw-r--r--mat/mat.py12
-rw-r--r--mat/office.py2
4 files changed, 13 insertions, 7 deletions
diff --git a/mat-cli b/mat-cli
index fbcaa62..00c5c11 100755
--- a/mat-cli
+++ b/mat-cli
@@ -61,7 +61,7 @@ def display_version(*_):
61 61
62def list_meta(class_file, filename, force): 62def list_meta(class_file, filename, force):
63 ''' 63 '''
64 Print all the metadataof 'filename' on stdout 64 Print all the metadata of 'filename' on stdout
65 ''' 65 '''
66 print('[+] File %s :' % filename) 66 print('[+] File %s :' % filename)
67 if force is False and class_file.is_clean(): 67 if force is False and class_file.is_clean():
diff --git a/mat/exiftool.py b/mat/exiftool.py
index c6c1ada..758a094 100644
--- a/mat/exiftool.py
+++ b/mat/exiftool.py
@@ -33,14 +33,14 @@ class ExiftoolStripper(parser.GenericParser):
33 try: 33 try:
34 if self.backup: 34 if self.backup:
35 # Note: '-All=' must be followed by a known exiftool option. 35 # Note: '-All=' must be followed by a known exiftool option.
36 process = subprocess.Popen(['exiftool', '-All=', 36 process = subprocess.Popen(['exiftool', '-m', '-All=',
37 '-out', self.output, self.filename], 37 '-out', self.output, self.filename],
38 stdout=open('/dev/null')) 38 stdout=open('/dev/null'))
39 process.wait() 39 process.wait()
40 else: 40 else:
41 # Note: '-All=' must be followed by a known exiftool option. 41 # Note: '-All=' must be followed by a known exiftool option.
42 process = subprocess.Popen( 42 process = subprocess.Popen(
43 [ 'exiftool', '-All=', '-overwrite_original', self.filename ], 43 [ 'exiftool', '-m', '-All=', '-overwrite_original', self.filename ],
44 stdout=open('/dev/null')) 44 stdout=open('/dev/null'))
45 process.wait() 45 process.wait()
46 return True 46 return True
diff --git a/mat/mat.py b/mat/mat.py
index 0e66df8..7fab98c 100644
--- a/mat/mat.py
+++ b/mat/mat.py
@@ -18,9 +18,15 @@ import strippers
18__version__ = '0.1' 18__version__ = '0.1'
19__author__ = 'jvoisin' 19__author__ = 'jvoisin'
20 20
21LOGGING_LEVEL = logging.DEBUG 21#Silence
22LOGGING_LEVEL = logging.CRITICAL
23hachoir_core.config.quiet = True
22 24
23logging.basicConfig(level=LOGGING_LEVEL) 25#Verbose
26#LOGGING_LEVEL = logging.DEBUG
27#hachoir_core.config.quiet = False
28
29logging.basicConfig(filename='report.log', level=LOGGING_LEVEL)
24 30
25 31
26def get_sharedir(): 32def get_sharedir():
@@ -31,7 +37,7 @@ def get_sharedir():
31 return '' 37 return ''
32 elif os.path.exists('/usr/local/share/mat/'): 38 elif os.path.exists('/usr/local/share/mat/'):
33 return '/usr/local/share/mat/' 39 return '/usr/local/share/mat/'
34 elif os.path.exist('/usr/share/mat/'): 40 elif os.path.exists('/usr/share/mat/'):
35 return '/usr/share/mat' 41 return '/usr/share/mat'
36 42
37 43
diff --git a/mat/office.py b/mat/office.py
index 41411c7..d1e781e 100644
--- a/mat/office.py
+++ b/mat/office.py
@@ -188,7 +188,7 @@ class PdfStripper(parser.GenericParser):
188 import exiftool 188 import exiftool
189 # Note: '-All=' must be followed by a known exiftool option. 189 # Note: '-All=' must be followed by a known exiftool option.
190 if self.backup: 190 if self.backup:
191 process = subprocess.Popen(['exiftool', '-All=', 191 process = subprocess.Popen(['exiftool', '-m', '-All=',
192 '-out', self.output, self.filename], stdout=open('/dev/null')) 192 '-out', self.output, self.filename], stdout=open('/dev/null'))
193 process.wait() 193 process.wait()
194 else: 194 else: