diff options
| author | Michael Williamson <mike@zwobble.org> | 2014-06-08 21:45:14 +0100 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2014-06-08 21:45:14 +0100 |
| commit | 178a640539e1af27fb7b64fc540adc17e58c30c4 (patch) | |
| tree | 6fc31d523668335cb72943f6299916b9f841ed1e /mammoth/document_matchers.py | |
| parent | 54faefdf17f764742da91685d10d589e0bc87f7d (diff) | |
Add support for reading style names in style maps
Diffstat (limited to 'mammoth/document_matchers.py')
| -rw-r--r-- | mammoth/document_matchers.py | 12 |
1 files changed, 6 insertions, 6 deletions
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" |
