From a3b542285331823ab8e05662a3ae0d5fc73f974f Mon Sep 17 00:00:00 2001 From: jvoisin Date: Thu, 3 May 2012 17:20:03 -0400 Subject: Better handling of dependencies regarding to PDF processing --- lib/office.py | 3 ++- lib/strippers.py | 5 +++-- 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): return True except: print('Unable to remove all metadata from %s, please install\ - pdfrw' % self.output) +pdfrw' % self.output) return False + return True def get_meta(self): ''' 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 = { try: # PDF support import poppler import cairo + import pdfrw STRIPPERS['application/x-pdf'] = office.PdfStripper STRIPPERS['application/pdf'] = office.PdfStripper except ImportError: - print('Unable to import python-poppler and/or python-cairo: no PDF \ - support') + print('Unable to import python-poppler and/or python-cairo \ +and/or pdfrw: no PDF support') try: # mutangen-python : audio format support import mutagen diff --git a/mat-gui b/mat-gui index df20cf8..eadf158 100755 --- a/mat-gui +++ b/mat-gui @@ -1,7 +1,6 @@ #!/usr/bin/env python # -*- coding: utf-8 -* - ''' Metadata anonymisation toolkit - GUI edition ''' @@ -560,8 +559,8 @@ non-anonymised) file to output archive')) if self.force is True or self.liststore[line][4] != _('Clean'): if self.liststore[line][0].file.remove_all(): self.liststore[line][4] = _('Clean') - if self.backup: # the backup copy state - self.liststore[line][5] = os.path.basename(self.liststore[line][0].file.output) + if self.backup: # the backup copy state + self.liststore[line][5] = os.path.basename(self.liststore[line][0].file.output) yield True self.statusbar.push(0, _('Ready')) yield False -- cgit v1.3