コード例 #1
0
ファイル: test_table.py プロジェクト: castaway/python-pptx
 def anchor_get_fixture(self, request):
     anchor, mso_anchor_idx = request.param
     tc_bldr = a_tc().with_nsdecls()
     if anchor is not None:
         tcPr_bldr = a_tcPr().with_anchor(anchor)
         tc_bldr.with_child(tcPr_bldr)
     tc = tc_bldr.element
     cell = _Cell(tc, None)
     return cell, mso_anchor_idx
コード例 #2
0
 def anchor_get_fixture(self, request):
     anchor, mso_anchor_idx = request.param
     tc_bldr = a_tc().with_nsdecls()
     if anchor is not None:
         tcPr_bldr = a_tcPr().with_anchor(anchor)
         tc_bldr.with_child(tcPr_bldr)
     tc = tc_bldr.element
     cell = _Cell(tc, None)
     return cell, mso_anchor_idx
コード例 #3
0
ファイル: test_table.py プロジェクト: castaway/python-pptx
 def anchor_set_fixture(self, request):
     def tc_with_anchor_bldr(anchor):
         tc_bldr = a_tc().with_nsdecls()
         if anchor is not None:
             tcPr_bldr = a_tcPr()
             if anchor != '':
                 tcPr_bldr.with_anchor(anchor)
             tc_bldr.with_child(tcPr_bldr)
         return tc_bldr
     before_anchor, mso_anchor_idx, after_anchor = request.param
     tc = tc_with_anchor_bldr(before_anchor).element
     cell = _Cell(tc, None)
     tc_with_anchor_xml = tc_with_anchor_bldr(after_anchor).xml()
     return cell, mso_anchor_idx, tc_with_anchor_xml
コード例 #4
0
 def anchor_set_fixture(self, request):
     def tc_with_anchor_bldr(anchor):
         tc_bldr = a_tc().with_nsdecls()
         if anchor is not None:
             tcPr_bldr = a_tcPr()
             if anchor != '':
                 tcPr_bldr.with_anchor(anchor)
             tc_bldr.with_child(tcPr_bldr)
         return tc_bldr
     before_anchor, mso_anchor_idx, after_anchor = request.param
     tc = tc_with_anchor_bldr(before_anchor).element
     cell = _Cell(tc, None)
     tc_with_anchor_xml = tc_with_anchor_bldr(after_anchor).xml()
     return cell, mso_anchor_idx, tc_with_anchor_xml
コード例 #5
0
 def margin_get_fixture(self, request):
     mar_vals, expected_vals = request.param
     marL, marR, marT, marB = mar_vals
     margin_left, margin_right, margin_top, margin_bottom = expected_vals
     tcPr_bldr = a_tcPr()
     if marL is not None:
         tcPr_bldr.with_marL(marL)
     if marR is not None:
         tcPr_bldr.with_marR(marR)
     if marT is not None:
         tcPr_bldr.with_marT(marT)
     if marB is not None:
         tcPr_bldr.with_marB(marB)
     tc = a_tc().with_nsdecls().with_child(tcPr_bldr).element
     cell = _Cell(tc, None)
     return cell, margin_left, margin_right, margin_top, margin_bottom
コード例 #6
0
ファイル: test_table.py プロジェクト: castaway/python-pptx
 def margin_get_fixture(self, request):
     mar_vals, expected_vals = request.param
     marL, marR, marT, marB = mar_vals
     margin_left, margin_right, margin_top, margin_bottom = expected_vals
     tcPr_bldr = a_tcPr()
     if marL is not None:
         tcPr_bldr.with_marL(marL)
     if marR is not None:
         tcPr_bldr.with_marR(marR)
     if marT is not None:
         tcPr_bldr.with_marT(marT)
     if marB is not None:
         tcPr_bldr.with_marB(marB)
     tc = a_tc().with_nsdecls().with_child(tcPr_bldr).element
     cell = _Cell(tc, None)
     return cell, margin_left, margin_right, margin_top, margin_bottom
コード例 #7
0
    def margin_set_fixture(self, request):

        def tc_bldr_with(marX):
            marL, marR, marT, marB = marX
            tcPr_bldr = a_tcPr()
            if marL is not None:
                tcPr_bldr.with_marL(marL)
            if marR is not None:
                tcPr_bldr.with_marR(marR)
            if marT is not None:
                tcPr_bldr.with_marT(marT)
            if marB is not None:
                tcPr_bldr.with_marB(marB)
            return a_tc().with_nsdecls().with_child(tcPr_bldr)

        before_vals, after_vals = request.param
        tc = tc_bldr_with(before_vals).element
        cell = _Cell(tc, None)

        marL, marR, marT, marB = after_vals

        tc_with_marX_xml = tc_bldr_with(after_vals).xml()

        return cell, marL, marR, marT, marB, tc_with_marX_xml
コード例 #8
0
ファイル: test_table.py プロジェクト: castaway/python-pptx
    def margin_set_fixture(self, request):

        def tc_bldr_with(marX):
            marL, marR, marT, marB = marX
            tcPr_bldr = a_tcPr()
            if marL is not None:
                tcPr_bldr.with_marL(marL)
            if marR is not None:
                tcPr_bldr.with_marR(marR)
            if marT is not None:
                tcPr_bldr.with_marT(marT)
            if marB is not None:
                tcPr_bldr.with_marB(marB)
            return a_tc().with_nsdecls().with_child(tcPr_bldr)

        before_vals, after_vals = request.param
        tc = tc_bldr_with(before_vals).element
        cell = _Cell(tc, None)

        marL, marR, marT, marB = after_vals

        tc_with_marX_xml = tc_bldr_with(after_vals).xml()

        return cell, marL, marR, marT, marB, tc_with_marX_xml
コード例 #9
0
 def cell(self):
     return _Cell(element('a:tc'), None)
コード例 #10
0
 def text_set_fixture(self, request):
     tc_cxml, new_text, expected_cxml = request.param
     cell = _Cell(element(tc_cxml), None)
     expected_xml = xml(expected_cxml)
     return cell, new_text, expected_xml
コード例 #11
0
 def margin_raises_fixture(self, request):
     margin_prop_name = request.param
     cell = _Cell(element('a:tc'), None)
     val_of_invalid_type = 'foobar'
     return cell, margin_prop_name, val_of_invalid_type
コード例 #12
0
 def margin_set_fixture(self, request):
     tc_cxml, margin_prop_name, new_value, expected_tc_cxml = request.param
     cell = _Cell(element(tc_cxml), None)
     expected_xml = xml(expected_tc_cxml)
     return cell, margin_prop_name, new_value, expected_xml
コード例 #13
0
 def margin_get_fixture(self, request):
     tc_cxml, margin_prop_name, expected_value = request.param
     cell = _Cell(element(tc_cxml), None)
     return cell, margin_prop_name, expected_value
コード例 #14
0
 def anchor_set_fixture(self, request):
     tc_cxml, new_value, expected_tc_cxml = request.param
     cell = _Cell(element(tc_cxml), None)
     expected_xml = xml(expected_tc_cxml)
     return cell, new_value, expected_xml
コード例 #15
0
ファイル: test_table.py プロジェクト: pjbayes/python-pptx
 def cell(self):
     return _Cell(element('a:tc'), None)
コード例 #16
0
ファイル: test_table.py プロジェクト: pjbayes/python-pptx
 def margin_get_fixture(self, request):
     tc_cxml, margin_prop_name, expected_value = request.param
     cell = _Cell(element(tc_cxml), None)
     return cell, margin_prop_name, expected_value
コード例 #17
0
ファイル: test_table.py プロジェクト: castaway/python-pptx
 def cell(self):
     tc = a_tc().with_nsdecls().element
     return _Cell(tc, None)
コード例 #18
0
ファイル: table.py プロジェクト: CSberger/python-pptx
 def cell(self):
     return _Cell(test_table_elements.cell, None)
コード例 #19
0
 def cell(self):
     tc = a_tc().with_nsdecls().element
     return _Cell(tc, None)
コード例 #20
0
ファイル: test_table.py プロジェクト: pjbayes/python-pptx
 def margin_raises_fixture(self, request):
     margin_prop_name = request.param
     cell = _Cell(element('a:tc'), None)
     val_of_invalid_type = 'foobar'
     return cell, margin_prop_name, val_of_invalid_type
コード例 #21
0
ファイル: test_table.py プロジェクト: pjbayes/python-pptx
 def anchor_set_fixture(self, request):
     tc_cxml, new_value, expected_tc_cxml = request.param
     cell = _Cell(element(tc_cxml), None)
     expected_xml = xml(expected_tc_cxml)
     return cell, new_value, expected_xml
コード例 #22
0
ファイル: test_table.py プロジェクト: pjbayes/python-pptx
 def text_set_fixture(self, request):
     tc_cxml, new_text, expected_cxml = request.param
     cell = _Cell(element(tc_cxml), None)
     expected_xml = xml(expected_cxml)
     return cell, new_text, expected_xml
コード例 #23
0
 def anchor_get_fixture(self, request):
     tc_cxml, expected_value = request.param
     cell = _Cell(element(tc_cxml), None)
     return cell, expected_value
コード例 #24
0
ファイル: test_table.py プロジェクト: pjbayes/python-pptx
 def margin_set_fixture(self, request):
     tc_cxml, margin_prop_name, new_value, expected_tc_cxml = request.param
     cell = _Cell(element(tc_cxml), None)
     expected_xml = xml(expected_tc_cxml)
     return cell, margin_prop_name, new_value, expected_xml
コード例 #25
0
 def cell(self):
     return _Cell(test_table_elements.cell, None)
コード例 #26
0
ファイル: test_table.py プロジェクト: pjbayes/python-pptx
 def anchor_get_fixture(self, request):
     tc_cxml, expected_value = request.param
     cell = _Cell(element(tc_cxml), None)
     return cell, expected_value