28
28
class CT_Ind (BaseOxmlElement ):
29
29
"""``<w:ind>`` element, specifying paragraph indentation."""
30
30
31
- left = OptionalAttribute ("w:left" , ST_SignedTwipsMeasure )
32
- right = OptionalAttribute ("w:right" , ST_SignedTwipsMeasure )
33
- firstLine = OptionalAttribute ("w:firstLine" , ST_TwipsMeasure )
34
- hanging = OptionalAttribute ("w:hanging" , ST_TwipsMeasure )
31
+ left : Length | None = OptionalAttribute ( # pyright: ignore[reportAssignmentType]
32
+ "w:left" , ST_SignedTwipsMeasure
33
+ )
34
+ right : Length | None = OptionalAttribute ( # pyright: ignore[reportAssignmentType]
35
+ "w:right" , ST_SignedTwipsMeasure
36
+ )
37
+ firstLine : Length | None = OptionalAttribute ( # pyright: ignore[reportAssignmentType]
38
+ "w:firstLine" , ST_TwipsMeasure
39
+ )
40
+ hanging : Length | None = OptionalAttribute ( # pyright: ignore[reportAssignmentType]
41
+ "w:hanging" , ST_TwipsMeasure
42
+ )
35
43
36
44
37
45
class CT_Jc (BaseOxmlElement ):
@@ -45,6 +53,7 @@ class CT_Jc(BaseOxmlElement):
45
53
class CT_PPr (BaseOxmlElement ):
46
54
"""``<w:pPr>`` element, containing the properties for a paragraph."""
47
55
56
+ get_or_add_ind : Callable [[], CT_Ind ]
48
57
get_or_add_pStyle : Callable [[], CT_String ]
49
58
_insert_sectPr : Callable [[CT_SectPr ], None ]
50
59
_remove_pStyle : Callable [[], None ]
@@ -98,13 +107,15 @@ class CT_PPr(BaseOxmlElement):
98
107
numPr = ZeroOrOne ("w:numPr" , successors = _tag_seq [7 :])
99
108
tabs = ZeroOrOne ("w:tabs" , successors = _tag_seq [11 :])
100
109
spacing = ZeroOrOne ("w:spacing" , successors = _tag_seq [22 :])
101
- ind = ZeroOrOne ("w:ind" , successors = _tag_seq [23 :])
110
+ ind : CT_Ind | None = ZeroOrOne ( # pyright: ignore[reportAssignmentType]
111
+ "w:ind" , successors = _tag_seq [23 :]
112
+ )
102
113
jc = ZeroOrOne ("w:jc" , successors = _tag_seq [27 :])
103
114
sectPr = ZeroOrOne ("w:sectPr" , successors = _tag_seq [35 :])
104
115
del _tag_seq
105
116
106
117
@property
107
- def first_line_indent (self ):
118
+ def first_line_indent (self ) -> Length | None :
108
119
"""A |Length| value calculated from the values of `w:ind/@w:firstLine` and
109
120
`w:ind/@w:hanging`.
110
121
@@ -122,7 +133,7 @@ def first_line_indent(self):
122
133
return firstLine
123
134
124
135
@first_line_indent .setter
125
- def first_line_indent (self , value ):
136
+ def first_line_indent (self , value : Length | None ):
126
137
if self .ind is None and value is None :
127
138
return
128
139
ind = self .get_or_add_ind ()
@@ -135,30 +146,30 @@ def first_line_indent(self, value):
135
146
ind .firstLine = value
136
147
137
148
@property
138
- def ind_left (self ):
149
+ def ind_left (self ) -> Length | None :
139
150
"""The value of `w:ind/@w:left` or |None| if not present."""
140
151
ind = self .ind
141
152
if ind is None :
142
153
return None
143
154
return ind .left
144
155
145
156
@ind_left .setter
146
- def ind_left (self , value ):
157
+ def ind_left (self , value : Length | None ):
147
158
if value is None and self .ind is None :
148
159
return
149
160
ind = self .get_or_add_ind ()
150
161
ind .left = value
151
162
152
163
@property
153
- def ind_right (self ):
164
+ def ind_right (self ) -> Length | None :
154
165
"""The value of `w:ind/@w:right` or |None| if not present."""
155
166
ind = self .ind
156
167
if ind is None :
157
168
return None
158
169
return ind .right
159
170
160
171
@ind_right .setter
161
- def ind_right (self , value ):
172
+ def ind_right (self , value : Length | None ):
162
173
if value is None and self .ind is None :
163
174
return
164
175
ind = self .get_or_add_ind ()
@@ -340,9 +351,15 @@ class CT_TabStop(BaseOxmlElement):
340
351
only needs a __str__ method.
341
352
"""
342
353
343
- val = RequiredAttribute ("w:val" , WD_TAB_ALIGNMENT )
344
- leader = OptionalAttribute ("w:leader" , WD_TAB_LEADER , default = WD_TAB_LEADER .SPACES )
345
- pos = RequiredAttribute ("w:pos" , ST_SignedTwipsMeasure )
354
+ val : WD_TAB_ALIGNMENT = RequiredAttribute ( # pyright: ignore[reportAssignmentType]
355
+ "w:val" , WD_TAB_ALIGNMENT
356
+ )
357
+ leader : WD_TAB_LEADER | None = OptionalAttribute ( # pyright: ignore[reportAssignmentType]
358
+ "w:leader" , WD_TAB_LEADER , default = WD_TAB_LEADER .SPACES
359
+ )
360
+ pos : Length = RequiredAttribute ( # pyright: ignore[reportAssignmentType]
361
+ "w:pos" , ST_SignedTwipsMeasure
362
+ )
346
363
347
364
def __str__ (self ) -> str :
348
365
"""Text equivalent of a `w:tab` element appearing in a run.
0 commit comments