From 4a35a848117c4fe646d36419096d099030878469 Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Sun, 1 Dec 2013 13:28:57 +0000 Subject: Add style_name to Run --- mammoth/documents.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'mammoth/documents.py') diff --git a/mammoth/documents.py b/mammoth/documents.py index 08e3bba..215df8e 100644 --- a/mammoth/documents.py +++ b/mammoth/documents.py @@ -1,11 +1,17 @@ import collections +Document = collections.namedtuple("Document", ["children"]) +Paragraph = collections.namedtuple("Paragraph", ["children", "style_name", "numbering"]) +Run = collections.namedtuple("Run", ["children", "style_name"]) +Text = collections.namedtuple("Text", ["value"]) + + +document = Document def paragraph(children, style_name=None, numbering=None): return Paragraph(children, style_name, numbering) +def run(children, style_name=None): + return Run(children, style_name) -Document = collections.namedtuple("Document", ["children"]) -Paragraph = collections.namedtuple("Paragraph", ["children", "style_name", "numbering"]) -Run = collections.namedtuple("Run", ["children"]) -Text = collections.namedtuple("Text", ["value"]) +text = Text -- cgit v1.2.3