diff options
Diffstat (limited to 'lib/office.py')
| -rw-r--r-- | lib/office.py | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/lib/office.py b/lib/office.py index ba12295..e21805a 100644 --- a/lib/office.py +++ b/lib/office.py | |||
| @@ -5,9 +5,7 @@ | |||
| 5 | import os | 5 | import os |
| 6 | import logging | 6 | import logging |
| 7 | import zipfile | 7 | import zipfile |
| 8 | import re | ||
| 9 | import fileinput | 8 | import fileinput |
| 10 | from xml.etree import ElementTree | ||
| 11 | 9 | ||
| 12 | try: | 10 | try: |
| 13 | import cairo | 11 | import cairo |
| @@ -36,10 +34,7 @@ class OpenDocumentStripper(archive.GenericArchiveStripper): | |||
| 36 | try: | 34 | try: |
| 37 | content = zipin.read('meta.xml') | 35 | content = zipin.read('meta.xml') |
| 38 | zipin.close() | 36 | zipin.close() |
| 39 | tree = ElementTree.fromstring(content) | 37 | metadata[self.filename] = 'harful meta' |
| 40 | for node in tree.iter(): | ||
| 41 | key = re.sub('{.*}', '', node.tag) | ||
| 42 | metadata[key] = node.text | ||
| 43 | except KeyError: # no meta.xml file found | 38 | except KeyError: # no meta.xml file found |
| 44 | logging.debug('%s has no opendocument metadata' % self.filename) | 39 | logging.debug('%s has no opendocument metadata' % self.filename) |
| 45 | return metadata | 40 | return metadata |
