diff options
| author | Michael Williamson <mike@zwobble.org> | 2018-01-24 08:35:02 +0000 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2018-01-24 08:35:02 +0000 |
| commit | 8f0d1c25178708d6b3878c7a433f07742bbba11c (patch) | |
| tree | 7fec40361f55352ed1eb044dfe66fef1b6ffbf8b /mammoth/docx | |
| parent | d4acfff9f5f17630a153f12276fa8a2016052c8b (diff) | |
Extract code for manipulating zip paths
Diffstat (limited to 'mammoth/docx')
| -rw-r--r-- | mammoth/docx/__init__.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/mammoth/docx/__init__.py b/mammoth/docx/__init__.py index a71ca0c..2bee161 100644 --- a/mammoth/docx/__init__.py +++ b/mammoth/docx/__init__.py @@ -1,7 +1,7 @@ from functools import partial import os -from .. import results, lists +from .. import results, lists, zips from .document_xml import read_document_xml_element from .content_types_xml import empty_content_types, read_content_types_xml_element from .relationships_xml import read_relationships_xml_element, Relationships @@ -125,8 +125,8 @@ def _part_with_body_reader(document_path, zip_file): def _find_relationships_path_for(name): - parts = name.split("/") - return "/".join(parts[:-1] + ["_rels/" + parts[-1] + ".rels"]) + dirname, basename = zips.split_path(name) + return zips.join_path(dirname, "_rels", basename + ".rels") def _read_relationships(zip_file, name): |
