From 178a640539e1af27fb7b64fc540adc17e58c30c4 Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Sun, 8 Jun 2014 21:45:14 +0100 Subject: Add support for reading style names in style maps --- mammoth/document_matchers.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'mammoth/document_matchers.py') diff --git a/mammoth/document_matchers.py b/mammoth/document_matchers.py index 014e4e3..222ee73 100644 --- a/mammoth/document_matchers.py +++ b/mammoth/document_matchers.py @@ -1,17 +1,17 @@ import collections -def paragraph(style_id=None, numbering=None): - return ParagraphMatcher(style_id, numbering) +def paragraph(style_id=None, style_name=None, numbering=None): + return ParagraphMatcher(style_id, style_name, numbering) -ParagraphMatcher = collections.namedtuple("ParagraphMatcher", ["style_id", "numbering"]) +ParagraphMatcher = collections.namedtuple("ParagraphMatcher", ["style_id", "style_name", "numbering"]) ParagraphMatcher.element_type = "paragraph" -def run(style_id=None): - return RunMatcher(style_id) +def run(style_id=None, style_name=None): + return RunMatcher(style_id, style_name) -RunMatcher = collections.namedtuple("RunMatcher", ["style_id"]) +RunMatcher = collections.namedtuple("RunMatcher", ["style_id", "style_name"]) RunMatcher.element_type = "run" -- cgit v1.2.3