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 /lib | |
| parent | e76571e2dddee0dba228d05579f6aef28630ba63 (diff) | |
Better handling of dependencies regarding to PDF processing
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/office.py | 3 | ||||
| -rw-r--r-- | lib/strippers.py | 5 |
2 files changed, 5 insertions, 3 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 |
