diff options
| author | jvoisin | 2011-11-18 00:54:46 +0100 |
|---|---|---|
| committer | jvoisin | 2011-11-18 00:54:46 +0100 |
| commit | f7653c3fba09ff06a87125d6f20c24368a21bf63 (patch) | |
| tree | a0f7bb9d023c7f33b432031143853fae42a0c692 | |
| parent | 7e43701c21b04338ce3c44f5d1ea918fa4315047 (diff) | |
| parent | f0e8e2d894ae4fcc6e0f87741dfb8511f52fc0c1 (diff) | |
Merge branch 'master' of git://git.torproject.org/user/jvoisin/mat
| -rwxr-xr-x | mat-cli | 2 | ||||
| -rw-r--r-- | mat/exiftool.py | 4 | ||||
| -rw-r--r-- | mat/mat.py | 12 | ||||
| -rw-r--r-- | mat/office.py | 2 |
4 files changed, 13 insertions, 7 deletions
| @@ -61,7 +61,7 @@ def display_version(*_): | |||
| 61 | 61 | ||
| 62 | def list_meta(class_file, filename, force): | 62 | def 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 |
| @@ -18,9 +18,15 @@ import strippers | |||
| 18 | __version__ = '0.1' | 18 | __version__ = '0.1' |
| 19 | __author__ = 'jvoisin' | 19 | __author__ = 'jvoisin' |
| 20 | 20 | ||
| 21 | LOGGING_LEVEL = logging.DEBUG | 21 | #Silence |
| 22 | LOGGING_LEVEL = logging.CRITICAL | ||
| 23 | hachoir_core.config.quiet = True | ||
| 22 | 24 | ||
| 23 | logging.basicConfig(level=LOGGING_LEVEL) | 25 | #Verbose |
| 26 | #LOGGING_LEVEL = logging.DEBUG | ||
| 27 | #hachoir_core.config.quiet = False | ||
| 28 | |||
| 29 | logging.basicConfig(filename='report.log', level=LOGGING_LEVEL) | ||
| 24 | 30 | ||
| 25 | 31 | ||
| 26 | def get_sharedir(): | 32 | def 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: |
