File: section.py

package info (click to toggle)
python-docx 1.1.2%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 6,904 kB
  • sloc: xml: 25,311; python: 23,028; makefile: 176
file content (51 lines) | stat: -rw-r--r-- 893 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
"""Test data builders for section-related XML elements."""

from ...unitdata import BaseBuilder


class CT_PageMarBuilder(BaseBuilder):
    __tag__ = "w:pgMar"
    __nspfxs__ = ("w",)
    __attrs__ = (
        "w:top",
        "w:right",
        "w:bottom",
        "w:left",
        "w:header",
        "w:footer",
        "w:gutter",
    )


class CT_PageSzBuilder(BaseBuilder):
    __tag__ = "w:pgSz"
    __nspfxs__ = ("w",)
    __attrs__ = ("w:w", "w:h", "w:orient", "w:code")


class CT_SectPrBuilder(BaseBuilder):
    __tag__ = "w:sectPr"
    __nspfxs__ = ("w",)
    __attrs__ = ()


class CT_SectTypeBuilder(BaseBuilder):
    __tag__ = "w:type"
    __nspfxs__ = ("w",)
    __attrs__ = ("w:val",)


def a_pgMar():
    return CT_PageMarBuilder()


def a_pgSz():
    return CT_PageSzBuilder()


def a_sectPr():
    return CT_SectPrBuilder()


def a_type():
    return CT_SectTypeBuilder()