File: table.py

package info (click to toggle)
python-docx 0.8.11%2Bdfsg1-5
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 6,640 kB
  • sloc: xml: 25,311; python: 21,911; makefile: 168
file content (92 lines) | stat: -rw-r--r-- 1,444 bytes parent folder | download
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
# encoding: utf-8

"""
Test data builders for text XML elements
"""

from ...unitdata import BaseBuilder
from .shared import CT_StringBuilder


class CT_RowBuilder(BaseBuilder):
    __tag__ = 'w:tr'
    __nspfxs__ = ('w',)
    __attrs__ = ('w:w',)


class CT_TblBuilder(BaseBuilder):
    __tag__ = 'w:tbl'
    __nspfxs__ = ('w',)
    __attrs__ = ()


class CT_TblGridBuilder(BaseBuilder):
    __tag__ = 'w:tblGrid'
    __nspfxs__ = ('w',)
    __attrs__ = ('w:w',)


class CT_TblGridColBuilder(BaseBuilder):
    __tag__ = 'w:gridCol'
    __nspfxs__ = ('w',)
    __attrs__ = ('w:w',)


class CT_TblPrBuilder(BaseBuilder):
    __tag__ = 'w:tblPr'
    __nspfxs__ = ('w',)
    __attrs__ = ()


class CT_TblWidthBuilder(BaseBuilder):
    __tag__ = 'w:tblW'
    __nspfxs__ = ('w',)
    __attrs__ = ('w:w', 'w:type')


class CT_TcBuilder(BaseBuilder):
    __tag__ = 'w:tc'
    __nspfxs__ = ('w',)
    __attrs__ = ('w:id',)


class CT_TcPrBuilder(BaseBuilder):
    __tag__ = 'w:tcPr'
    __nspfxs__ = ('w',)
    __attrs__ = ()


def a_gridCol():
    return CT_TblGridColBuilder()


def a_tbl():
    return CT_TblBuilder()


def a_tblGrid():
    return CT_TblGridBuilder()


def a_tblPr():
    return CT_TblPrBuilder()


def a_tblStyle():
    return CT_StringBuilder('w:tblStyle')


def a_tblW():
    return CT_TblWidthBuilder()


def a_tc():
    return CT_TcBuilder()


def a_tcPr():
    return CT_TcPrBuilder()


def a_tr():
    return CT_RowBuilder()