diff options
| author | jvoisin | 2012-05-03 17:20:03 -0400 |
|---|---|---|
| committer | jvoisin | 2012-05-03 17:20:03 -0400 |
| commit | a3b542285331823ab8e05662a3ae0d5fc73f974f (patch) | |
| tree | 5e0adb7f27d929e318f9365bc913925bc2eaed39 | |
| parent | e76571e2dddee0dba228d05579f6aef28630ba63 (diff) | |
Better handling of dependencies regarding to PDF processing
| -rw-r--r-- | lib/office.py | 3 | ||||
| -rw-r--r-- | lib/strippers.py | 5 | ||||
| -rwxr-xr-x | mat-gui | 5 |
3 files changed, 7 insertions, 6 deletions
diff --git a/lib/office.py b/lib/office.py index 8350244..b557a6c 100644 --- a/lib/office.py +++ b/lib/office.py | |||
| @@ -179,8 +179,9 @@ class PdfStripper(parser.GenericParser): | |||
| 179 | return True | 179 | return True |
| 180 | except: | 180 | except: |
| 181 | print('Unable to remove all metadata from %s, please install\ | 181 | print('Unable to remove all metadata from %s, please install\ |
| 182 | pdfrw' % self.output) | 182 | pdfrw' % self.output) |
| 183 | return False | 183 | return False |
| 184 | return True | ||
| 184 | 185 | ||
| 185 | def get_meta(self): | 186 | def get_meta(self): |
| 186 | ''' | 187 | ''' |
diff --git a/lib/strippers.py b/lib/strippers.py index 7d27874..dfdf1ea 100644 --- a/lib/strippers.py +++ b/lib/strippers.py | |||
| @@ -23,11 +23,12 @@ STRIPPERS = { | |||
| 23 | try: # PDF support | 23 | try: # PDF support |
| 24 | import poppler | 24 | import poppler |
| 25 | import cairo | 25 | import cairo |
| 26 | import pdfrw | ||
| 26 | STRIPPERS['application/x-pdf'] = office.PdfStripper | 27 | STRIPPERS['application/x-pdf'] = office.PdfStripper |
| 27 | STRIPPERS['application/pdf'] = office.PdfStripper | 28 | STRIPPERS['application/pdf'] = office.PdfStripper |
| 28 | except ImportError: | 29 | except ImportError: |
| 29 | print('Unable to import python-poppler and/or python-cairo: no PDF \ | 30 | print('Unable to import python-poppler and/or python-cairo \ |
| 30 | support') | 31 | and/or pdfrw: no PDF support') |
| 31 | 32 | ||
| 32 | try: # mutangen-python : audio format support | 33 | try: # mutangen-python : audio format support |
| 33 | import mutagen | 34 | import mutagen |
| @@ -1,7 +1,6 @@ | |||
| 1 | #!/usr/bin/env python | 1 | #!/usr/bin/env python |
| 2 | # -*- coding: utf-8 -* | 2 | # -*- coding: utf-8 -* |
| 3 | 3 | ||
| 4 | |||
| 5 | ''' | 4 | ''' |
| 6 | Metadata anonymisation toolkit - GUI edition | 5 | Metadata anonymisation toolkit - GUI edition |
| 7 | ''' | 6 | ''' |
| @@ -560,8 +559,8 @@ non-anonymised) file to output archive')) | |||
| 560 | if self.force is True or self.liststore[line][4] != _('Clean'): | 559 | if self.force is True or self.liststore[line][4] != _('Clean'): |
| 561 | if self.liststore[line][0].file.remove_all(): | 560 | if self.liststore[line][0].file.remove_all(): |
| 562 | self.liststore[line][4] = _('Clean') | 561 | self.liststore[line][4] = _('Clean') |
| 563 | if self.backup: # the backup copy state | 562 | if self.backup: # the backup copy state |
| 564 | self.liststore[line][5] = os.path.basename(self.liststore[line][0].file.output) | 563 | self.liststore[line][5] = os.path.basename(self.liststore[line][0].file.output) |
| 565 | yield True | 564 | yield True |
| 566 | self.statusbar.push(0, _('Ready')) | 565 | self.statusbar.push(0, _('Ready')) |
| 567 | yield False | 566 | yield False |
