aboutsummaryrefslogtreecommitdiff
path: root/mammoth/documents.py
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2014-01-08 18:01:44 +0000
committerMichael Williamson <mike@zwobble.org>2014-01-08 18:01:44 +0000
commit78d5cca66ca8f204d5db1aff81519c142705add9 (patch)
tree441137c92cecb64833b8ae05800e7799d914eebd /mammoth/documents.py
parentd79153e4cc40ccd13d78cfdc463b55ce6913d221 (diff)
Add transform_document argument to convert_to_html
Diffstat (limited to 'mammoth/documents.py')
-rw-r--r--mammoth/documents.py15
1 files changed, 8 insertions, 7 deletions
diff --git a/mammoth/documents.py b/mammoth/documents.py
index 0f2d767..65a9b84 100644
--- a/mammoth/documents.py
+++ b/mammoth/documents.py
@@ -1,10 +1,11 @@
-import collections
+import dodge
-Document = collections.namedtuple("Document", ["children"])
-Paragraph = collections.namedtuple("Paragraph", ["children", "style_name", "numbering"])
-Run = collections.namedtuple("Run", ["children", "style_name", "is_bold", "is_italic"])
-Text = collections.namedtuple("Text", ["value"])
-Hyperlink = collections.namedtuple("Hyperlink", ["href", "children"])
+
+Document = dodge.data_class("Document", ["children"])
+Paragraph = dodge.data_class("Paragraph", ["children", "style_name", "numbering"])
+Run = dodge.data_class("Run", ["children", "style_name", "is_bold", "is_italic"])
+Text = dodge.data_class("Text", ["value"])
+Hyperlink = dodge.data_class("Hyperlink", ["href", "children"])
class Tab(object):
pass
@@ -40,4 +41,4 @@ hyperlink = Hyperlink
def numbering_level(level_index, is_ordered):
return _NumberingLevel(str(level_index), bool(is_ordered))
-_NumberingLevel = collections.namedtuple("NumberingLevel", ["level_index", "is_ordered"])
+_NumberingLevel = dodge.data_class("NumberingLevel", ["level_index", "is_ordered"])