diff options
| author | Michael Williamson <mike@zwobble.org> | 2019-03-17 18:37:32 +0000 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2019-03-17 18:37:32 +0000 |
| commit | 2c01dcb90076ebaeee903302f7948a745b1abd87 (patch) | |
| tree | 025b26f102f3a2ed38c2389ee4422eb8bb77b9fc /mammoth/docx | |
| parent | 6d5fe54cd6183d12c0e984d9d0d7e3204817583f (diff) | |
Create object for abstract nums
Diffstat (limited to 'mammoth/docx')
| -rw-r--r-- | mammoth/docx/numbering_xml.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/mammoth/docx/numbering_xml.py b/mammoth/docx/numbering_xml.py index 31a0d3c..8d9af70 100644 --- a/mammoth/docx/numbering_xml.py +++ b/mammoth/docx/numbering_xml.py @@ -17,7 +17,12 @@ def _read_abstract_nums(element): def _read_abstract_num(element): abstract_num_id = element.attributes.get("w:abstractNumId") levels = _read_abstract_num_levels(element) - return abstract_num_id, levels + return abstract_num_id, _AbstractNum(levels=levels) + + +@cobble.data +class _AbstractNum(object): + levels = cobble.field() def _read_abstract_num_levels(element): @@ -65,4 +70,4 @@ class Numbering(object): return None else: abstract_num = self._abstract_nums[num.abstract_num_id] - return abstract_num.get(level) + return abstract_num.levels.get(level) |
