diff options
| author | jvoisin | 2013-08-11 18:01:21 +0200 |
|---|---|---|
| committer | jvoisin | 2013-08-11 18:01:21 +0200 |
| commit | 29c18e106ef5740e0b5397893c573642f620cd89 (patch) | |
| tree | 011db5d847cb7a1a286fde4456d74890c3cb57c8 | |
| parent | cdcb25efcca990a2a8b1cf47ab709de30b0f6e7e (diff) | |
Minor cleanup/typoes
| -rw-r--r-- | MAT/office.py | 5 | ||||
| -rw-r--r-- | MAT/parser.py | 4 |
2 files changed, 5 insertions, 4 deletions
diff --git a/MAT/office.py b/MAT/office.py index 339f3e3..50a4282 100644 --- a/MAT/office.py +++ b/MAT/office.py | |||
| @@ -14,6 +14,7 @@ try: | |||
| 14 | import cairo | 14 | import cairo |
| 15 | from gi.repository import Poppler | 15 | from gi.repository import Poppler |
| 16 | except ImportError: | 16 | except ImportError: |
| 17 | logging.info('office.py loaded without PDF support') | ||
| 17 | pass | 18 | pass |
| 18 | 19 | ||
| 19 | import mat | 20 | import mat |
| @@ -44,7 +45,7 @@ class OpenDocumentStripper(archive.GenericArchiveStripper): | |||
| 44 | metadata[nodename] = ''.join([j.data for j in i.childNodes]) | 45 | metadata[nodename] = ''.join([j.data for j in i.childNodes]) |
| 45 | else: | 46 | else: |
| 46 | # thank you w3c for not providing a nice | 47 | # thank you w3c for not providing a nice |
| 47 | # method to get all attributes from a node | 48 | # method to get all attributes of a node |
| 48 | pass | 49 | pass |
| 49 | zipin.close() | 50 | zipin.close() |
| 50 | except KeyError: # no meta.xml file found | 51 | except KeyError: # no meta.xml file found |
| @@ -162,7 +163,7 @@ class PdfStripper(parser.GenericParser): | |||
| 162 | surface = cairo.PDFSurface(output, page_width, page_height) | 163 | surface = cairo.PDFSurface(output, page_width, page_height) |
| 163 | context = cairo.Context(surface) # context draws on the surface | 164 | context = cairo.Context(surface) # context draws on the surface |
| 164 | logging.debug('PDF rendering of %s' % self.filename) | 165 | logging.debug('PDF rendering of %s' % self.filename) |
| 165 | for pagenum in xrange(self.document.get_n_pages()): | 166 | for pagenum in range(self.document.get_n_pages()): |
| 166 | page = self.document.get_page(pagenum) | 167 | page = self.document.get_page(pagenum) |
| 167 | context.translate(0, 0) | 168 | context.translate(0, 0) |
| 168 | if self.pdf_quality: | 169 | if self.pdf_quality: |
diff --git a/MAT/parser.py b/MAT/parser.py index e956164..949e24b 100644 --- a/MAT/parser.py +++ b/MAT/parser.py | |||
| @@ -11,12 +11,12 @@ import shutil | |||
| 11 | 11 | ||
| 12 | import mat | 12 | import mat |
| 13 | 13 | ||
| 14 | NOMETA = ('.bmp', # image | 14 | NOMETA = frozenset(('.bmp', # image |
| 15 | '.rdf', # text | 15 | '.rdf', # text |
| 16 | '.txt', # plain text | 16 | '.txt', # plain text |
| 17 | '.xml', # formated text (XML) | 17 | '.xml', # formated text (XML) |
| 18 | '.rels', # openXML formated text | 18 | '.rels', # openXML formated text |
| 19 | ) | 19 | )) |
| 20 | 20 | ||
| 21 | FIELD = object() | 21 | FIELD = object() |
| 22 | 22 | ||
