File tree 2 files changed +9
-9
lines changed
2 files changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -79,12 +79,12 @@ def _tblPr(self):
79
79
return self ._tbl .tblPr
80
80
81
81
82
- class _Cell (object ):
82
+ class _Cell (Parented ):
83
83
"""
84
84
Table cell
85
85
"""
86
- def __init__ (self , tc ):
87
- super (_Cell , self ).__init__ ()
86
+ def __init__ (self , tc , parent ):
87
+ super (_Cell , self ).__init__ (parent )
88
88
self ._tc = tc
89
89
90
90
@property
@@ -159,12 +159,12 @@ def __getitem__(self, idx):
159
159
msg = "cell index [%d] is out of range" % idx
160
160
raise IndexError (msg )
161
161
tc = tr .tc_lst [self ._col_idx ]
162
- return _Cell (tc )
162
+ return _Cell (tc , self )
163
163
164
164
def __iter__ (self ):
165
165
for tr in self ._tr_lst :
166
166
tc = tr .tc_lst [self ._col_idx ]
167
- yield _Cell (tc )
167
+ yield _Cell (tc , self )
168
168
169
169
def __len__ (self ):
170
170
return len (self ._tr_lst )
@@ -250,10 +250,10 @@ def __getitem__(self, idx):
250
250
except IndexError :
251
251
msg = "cell index [%d] is out of range" % idx
252
252
raise IndexError (msg )
253
- return _Cell (tc )
253
+ return _Cell (tc , self )
254
254
255
255
def __iter__ (self ):
256
- return (_Cell (tc ) for tc in self ._tr .tc_lst )
256
+ return (_Cell (tc , self ) for tc in self ._tr .tc_lst )
257
257
258
258
def __len__ (self ):
259
259
return len (self ._tr .tc_lst )
Original file line number Diff line number Diff line change @@ -142,13 +142,13 @@ def it_can_replace_its_content_with_a_string_of_text(
142
142
])
143
143
def text_set_fixture (self , request ):
144
144
tc_cxml , new_text , expected_cxml = request .param
145
- cell = _Cell (element (tc_cxml ))
145
+ cell = _Cell (element (tc_cxml ), None )
146
146
expected_xml = xml (expected_cxml )
147
147
return cell , new_text , expected_xml
148
148
149
149
@pytest .fixture
150
150
def paragraphs_fixture (self ):
151
- return _Cell (element ('w:tc/(w:p, w:p)' ))
151
+ return _Cell (element ('w:tc/(w:p, w:p)' ), None )
152
152
153
153
154
154
class Describe_Column (object ):
You can’t perform that action at this time.
0 commit comments