From 61e88321b9e5dc67a0373edc69f8114db8c1d3b7 Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Sun, 11 May 2014 18:01:31 +0100 Subject: Rename existing concept of style names to style IDs to match docx --- mammoth/docx/document_xml.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'mammoth/docx/document_xml.py') diff --git a/mammoth/docx/document_xml.py b/mammoth/docx/document_xml.py index e4682a6..5023ec5 100644 --- a/mammoth/docx/document_xml.py +++ b/mammoth/docx/document_xml.py @@ -42,7 +42,7 @@ def _create_reader(numbering, content_types, relationships, docx_file): @handler("w:r") def run(element): properties = element.find_child_or_null("w:rPr") - style_name = properties \ + style_id = properties \ .find_child_or_null("w:rStyle") \ .attributes.get("w:val") is_bold = properties.find_child("w:b") @@ -51,7 +51,7 @@ def _create_reader(numbering, content_types, relationships, docx_file): return _read_xml_elements(element.children) \ .map(lambda children: documents.run( children=children, - style_name=style_name, + style_id=style_id, is_bold=is_bold, is_italic=is_italic, )) @@ -60,7 +60,7 @@ def _create_reader(numbering, content_types, relationships, docx_file): @handler("w:p") def paragraph(element): properties = element.find_child_or_null("w:pPr") - style_name = properties \ + style_id = properties \ .find_child_or_null("w:pStyle") \ .attributes.get("w:val") numbering_properties = properties.find_child("w:numPr") @@ -72,7 +72,7 @@ def _create_reader(numbering, content_types, relationships, docx_file): return _read_xml_elements(element.children) \ .map(lambda children: documents.paragraph( children=children, - style_name=style_name, + style_id=style_id, numbering=numbering, )) -- cgit v1.2.3