summaryrefslogtreecommitdiff
path: root/MAT
diff options
context:
space:
mode:
authorjvoisin2013-08-11 18:01:21 +0200
committerjvoisin2013-08-11 18:01:21 +0200
commit29c18e106ef5740e0b5397893c573642f620cd89 (patch)
tree011db5d847cb7a1a286fde4456d74890c3cb57c8 /MAT
parentcdcb25efcca990a2a8b1cf47ab709de30b0f6e7e (diff)
Minor cleanup/typoes
Diffstat (limited to 'MAT')
-rw-r--r--MAT/office.py5
-rw-r--r--MAT/parser.py4
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
16except ImportError: 16except ImportError:
17 logging.info('office.py loaded without PDF support')
17 pass 18 pass
18 19
19import mat 20import 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
12import mat 12import mat
13 13
14NOMETA = ('.bmp', # image 14NOMETA = 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
21FIELD = object() 21FIELD = object()
22 22