aboutsummaryrefslogtreecommitdiff
path: root/mammoth/docx/style_map.py
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2015-09-12 16:31:05 +0100
committerMichael Williamson <mike@zwobble.org>2015-09-12 16:31:05 +0100
commitc0a034ba83fb75031d839e49b699b8093432cfd0 (patch)
treea58b762f70cfbac777108a375ff8d93f9dde0d47 /mammoth/docx/style_map.py
parent4c88820f3d4778e75a4be50f7a2d78d03dc86316 (diff)
Support overwriting embedded style map
Diffstat (limited to 'mammoth/docx/style_map.py')
-rw-r--r--mammoth/docx/style_map.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/mammoth/docx/style_map.py b/mammoth/docx/style_map.py
index 2841830..94c32af 100644
--- a/mammoth/docx/style_map.py
+++ b/mammoth/docx/style_map.py
@@ -1,12 +1,13 @@
-from ..zips import open_zip
+from ..zips import open_zip, update_zip
_style_map_path = "mammoth/style-map"
def write_style_map(fileobj, style_map):
- with open_zip(fileobj, "a") as zip_file:
- zip_file.write_str(_style_map_path, style_map)
+ update_zip(fileobj, {
+ _style_map_path: style_map
+ })
def read_style_map(fileobj):