コード例 #1
0
 def clone_fixture(self, slide_layout_, placeholder_,
                   _clone_layout_placeholder_):
     shapes = _SlideShapeTree(None)
     slide_layout_.iter_cloneable_placeholders.return_value = (iter(
         [placeholder_]))
     return (shapes, slide_layout_, placeholder_,
             _clone_layout_placeholder_)
コード例 #2
0
 def ph_name_fixture(self, request, slide_):
     ph_type, id_, orient, expected_name = request.param
     slide_.spTree = (an_spTree().with_nsdecls().with_child(
         a_cNvPr().with_name('Title 1')).with_child(
             a_cNvPr().with_name('Table Placeholder 3'))).element
     shapes = _SlideShapeTree(slide_)
     return shapes, ph_type, id_, orient, expected_name
コード例 #3
0
ファイル: shape.py プロジェクト: karthik1024/python-pptx
    def empty_shape_collection(self):
        class FakeSlide(object):
            pass

        slide = FakeSlide()
        slide.spTree = test_shape_elements.empty_spTree
        return _SlideShapeTree(slide)
コード例 #4
0
 def table_fixture(self, rows_, cols_, x_, y_, cx_, cy_,
                   _add_graphicFrame_containing_table_, _shape_factory_,
                   graphicFrame_, table_):
     shapes = _SlideShapeTree(None)
     _shape_factory_.return_value = table_
     return (shapes, rows_, cols_, x_, y_, cx_, cy_,
             _add_graphicFrame_containing_table_, _shape_factory_,
             graphicFrame_, table_)
コード例 #5
0
 def add_chart_graph_frm_fixture(self, rId_, x_, y_, cx_, cy_,
                                 _add_chart_graphicFrame_,
                                 _SlideShapeFactory_, graphicFrame_,
                                 graphic_frame_):
     shape_tree = _SlideShapeTree(None)
     _SlideShapeFactory_.return_value = graphic_frame_
     return (shape_tree, rId_, x_, y_, cx_, cy_, _add_chart_graphicFrame_,
             _SlideShapeFactory_, graphicFrame_, graphic_frame_)
コード例 #6
0
ファイル: test_slide.py プロジェクト: eduvant/python-pptx
 def clone_ph_fixture(
         self, slide_, layout_placeholder_, spTree_, _next_shape_id_, id_,
         _next_ph_name_, name_, ph_type_, orient_, sz_, idx_):
     shapes = _SlideShapeTree(slide_)
     return (
         shapes, layout_placeholder_, spTree_, id_, name_, ph_type_,
         orient_, sz_, idx_
     )
コード例 #7
0
 def autoshape_fixture(self, autoshape_type_id_, x_, y_, cx_, cy_,
                       AutoShapeType_, _add_sp_from_autoshape_type_,
                       autoshape_type_, _shape_factory_, sp_, shape_):
     shapes = _SlideShapeTree(None)
     _shape_factory_.return_value = shape_
     return (shapes, autoshape_type_id_, x_, y_, cx_, cy_, AutoShapeType_,
             _add_sp_from_autoshape_type_, autoshape_type_, _shape_factory_,
             sp_, shape_)
コード例 #8
0
ファイル: test_slide.py プロジェクト: eduvant/python-pptx
 def ph_name_fixture(self, request, slide_):
     ph_type, id_, orient, expected_name = request.param
     slide_.spTree = (
         an_spTree().with_nsdecls().with_child(
             a_cNvPr().with_name('Title 1')).with_child(
             a_cNvPr().with_name('Table Placeholder 3'))
     ).element
     shapes = _SlideShapeTree(slide_)
     return shapes, ph_type, id_, orient, expected_name
コード例 #9
0
ファイル: test_slide.py プロジェクト: eduvant/python-pptx
 def graphicFrame_fixture(
         self, slide_, rows_, cols_, x_, y_, cx_, cy_, spTree_,
         _next_shape_id_, id_, graphicFrame_):
     shapes = _SlideShapeTree(slide_)
     name = 'Table 41'
     return (
         shapes, rows_, cols_, x_, y_, cx_, cy_, spTree_, id_, name,
         graphicFrame_
     )
コード例 #10
0
ファイル: test_slide.py プロジェクト: eduvant/python-pptx
 def clone_fixture(
         self, slide_layout_, placeholder_, _clone_layout_placeholder_):
     shapes = _SlideShapeTree(None)
     slide_layout_.iter_cloneable_placeholders.return_value = (
         iter([placeholder_])
     )
     return (
         shapes, slide_layout_, placeholder_, _clone_layout_placeholder_
     )
コード例 #11
0
ファイル: test_slide.py プロジェクト: eduvant/python-pptx
 def add_chart_graph_frm_fixture(
         self, rId_, x_, y_, cx_, cy_, _add_chart_graphicFrame_,
         _SlideShapeFactory_, graphicFrame_, graphic_frame_):
     shape_tree = _SlideShapeTree(None)
     _SlideShapeFactory_.return_value = graphic_frame_
     return (
         shape_tree, rId_, x_, y_, cx_, cy_, _add_chart_graphicFrame_,
         _SlideShapeFactory_, graphicFrame_, graphic_frame_
     )
コード例 #12
0
ファイル: test_slide.py プロジェクト: eduvant/python-pptx
 def pic_fixture(
         self, slide_, image_part_, rId_, x_, y_, cx_, cy_, spTree_,
         _next_shape_id_, id_, name, desc_, scaled_cx_, scaled_cy_,
         pic_):
     shapes = _SlideShapeTree(slide_)
     return (
         shapes, image_part_, rId_, x_, y_, cx_, cy_, spTree_, id_,
         name, desc_, scaled_cx_, scaled_cy_, pic_
     )
コード例 #13
0
ファイル: test_slide.py プロジェクト: eduvant/python-pptx
 def textbox_fixture(
         self, x_, y_, cx_, cy_, _add_textbox_sp_, _shape_factory_,
         sp_, textbox_):
     shapes = _SlideShapeTree(None)
     _shape_factory_.return_value = textbox_
     return (
         shapes, x_, y_, cx_, cy_, _add_textbox_sp_, _shape_factory_,
         sp_, textbox_
     )
コード例 #14
0
ファイル: test_slide.py プロジェクト: eduvant/python-pptx
 def add_chart_fixture(
         self, slide_, chart_type_, chart_data_, rId_,
         _add_chart_graphic_frame_, graphic_frame_):
     shape_tree = _SlideShapeTree(slide_)
     x, y, cx, cy = 1, 2, 3, 4
     return (
         shape_tree, chart_type_, x, y, cx, cy, chart_data_, rId_,
         graphic_frame_
     )
コード例 #15
0
ファイル: test_slide.py プロジェクト: eduvant/python-pptx
 def sp_fixture(
         self, slide_, autoshape_type_, x_, y_, cx_, cy_, spTree_,
         _next_shape_id_, id_, prst_, sp_):
     shapes = _SlideShapeTree(slide_)
     name = 'Foobar 41'
     return (
         shapes, autoshape_type_, x_, y_, cx_, cy_, spTree_, id_, name,
         prst_, sp_
     )
コード例 #16
0
 def picture_fixture(self, image_file_, x_, y_, cx_, cy_,
                     _get_or_add_image_part_, image_part_, rId_,
                     _add_pic_from_image_part_, pic_, _shape_factory_,
                     picture_):
     shapes = _SlideShapeTree(None)
     _shape_factory_.return_value = picture_
     return (shapes, image_file_, x_, y_, cx_, cy_, _get_or_add_image_part_,
             image_part_, rId_, _add_pic_from_image_part_, pic_,
             _shape_factory_, picture_)
コード例 #17
0
ファイル: test_slide.py プロジェクト: eduvant/python-pptx
 def picture_fixture(
         self, slide_, image_file_, x_, y_, cx_, cy_, image_part_, rId_,
         _add_pic_from_image_part_, pic_, _shape_factory_, picture_):
     shapes = _SlideShapeTree(slide_)
     slide_.get_or_add_image_part.return_value = (image_part_, rId_)
     _shape_factory_.return_value = picture_
     return (
         shapes, image_file_, x_, y_, cx_, cy_, image_part_, rId_, pic_,
         picture_
     )
コード例 #18
0
ファイル: test_slide.py プロジェクト: eduvant/python-pptx
 def autoshape_fixture(
         self, autoshape_type_id_, x_, y_, cx_, cy_, AutoShapeType_,
         _add_sp_from_autoshape_type_, autoshape_type_, _shape_factory_,
         sp_, shape_):
     shapes = _SlideShapeTree(None)
     _shape_factory_.return_value = shape_
     return (
         shapes, autoshape_type_id_, x_, y_, cx_, cy_, AutoShapeType_,
         _add_sp_from_autoshape_type_, autoshape_type_, _shape_factory_,
         sp_, shape_
     )
コード例 #19
0
ファイル: test_slide.py プロジェクト: eduvant/python-pptx
 def table_fixture(
         self, rows_, cols_, x_, y_, cx_, cy_,
         _add_graphicFrame_containing_table_, _shape_factory_,
         graphicFrame_, table_):
     shapes = _SlideShapeTree(None)
     _shape_factory_.return_value = table_
     return (
         shapes, rows_, cols_, x_, y_, cx_, cy_,
         _add_graphicFrame_containing_table_, _shape_factory_,
         graphicFrame_, table_
     )
コード例 #20
0
 def add_chart_graphicFrame_fixture(self, slide_, _next_shape_id_, id_):
     rId, x, y, cx, cy = 'rId42', 1, 2, 3, 4
     shape_tree = _SlideShapeTree(slide_)
     expected_xml = (
         '<p:graphicFrame xmlns:a="http://schemas.openxmlformats.org/draw'
         'ingml/2006/main" xmlns:p="http://schemas.openxmlformats.org/pre'
         'sentationml/2006/main">\n  <p:nvGraphicFramePr>\n    <p:cNvPr i'
         'd="42" name="Chart 41"/>\n    <p:cNvGraphicFramePr>\n      <a:g'
         'raphicFrameLocks noGrp="1"/>\n    </p:cNvGraphicFramePr>\n    <'
         'p:nvPr/>\n  </p:nvGraphicFramePr>\n  <p:xfrm>\n    <a:off x="1"'
         ' y="2"/>\n    <a:ext cx="3" cy="4"/>\n  </p:xfrm>\n  <a:graphic'
         '>\n    <a:graphicData uri="http://schemas.openxmlformats.org/dr'
         'awingml/2006/chart">\n      <c:chart xmlns:c="http://schemas.op'
         'enxmlformats.org/drawingml/2006/chart" xmlns:r="http://schemas.'
         'openxmlformats.org/officeDocument/2006/relationships" r:id="rId'
         '42"/>\n    </a:graphicData>\n  </a:graphic>\n</p:graphicFrame>'
         '\n')
     return (shape_tree, rId, x, y, cx, cy, expected_xml)
コード例 #21
0
ファイル: test_slide.py プロジェクト: eduvant/python-pptx
 def add_chart_graphicFrame_fixture(self, slide_, _next_shape_id_, id_):
     rId, x, y, cx, cy = 'rId42', 1, 2, 3, 4
     shape_tree = _SlideShapeTree(slide_)
     expected_xml = (
         '<p:graphicFrame xmlns:a="http://schemas.openxmlformats.org/draw'
         'ingml/2006/main" xmlns:p="http://schemas.openxmlformats.org/pre'
         'sentationml/2006/main">\n  <p:nvGraphicFramePr>\n    <p:cNvPr i'
         'd="42" name="Chart 41"/>\n    <p:cNvGraphicFramePr>\n      <a:g'
         'raphicFrameLocks noGrp="1"/>\n    </p:cNvGraphicFramePr>\n    <'
         'p:nvPr/>\n  </p:nvGraphicFramePr>\n  <p:xfrm>\n    <a:off x="1"'
         ' y="2"/>\n    <a:ext cx="3" cy="4"/>\n  </p:xfrm>\n  <a:graphic'
         '>\n    <a:graphicData uri="http://schemas.openxmlformats.org/dr'
         'awingml/2006/chart">\n      <c:chart xmlns:c="http://schemas.op'
         'enxmlformats.org/drawingml/2006/chart" xmlns:r="http://schemas.'
         'openxmlformats.org/officeDocument/2006/relationships" r:id="rId'
         '42"/>\n    </a:graphicData>\n  </a:graphic>\n</p:graphicFrame>'
         '\n'
     )
     return (
         shape_tree, rId, x, y, cx, cy, expected_xml
     )
コード例 #22
0
 def factory_fixture(self, ph_elm_, _SlideShapeFactory_,
                     slide_placeholder_):
     shapes = _SlideShapeTree(None)
     _SlideShapeFactory_.return_value = slide_placeholder_
     return shapes, ph_elm_, _SlideShapeFactory_, slide_placeholder_
コード例 #23
0
 def clone_ph_fixture(self, slide_, layout_placeholder_, spTree_,
                      _next_shape_id_, id_, _next_ph_name_, name_, ph_type_,
                      orient_, sz_, idx_):
     shapes = _SlideShapeTree(slide_)
     return (shapes, layout_placeholder_, spTree_, id_, name_, ph_type_,
             orient_, sz_, idx_)
コード例 #24
0
 def index_fixture(self, slide_, shape_):
     shapes = _SlideShapeTree(slide_)
     expected_idx = 1
     return shapes, shape_, expected_idx
コード例 #25
0
ファイル: shape.py プロジェクト: CSberger/python-pptx
 def empty_shape_collection(self):
     class FakeSlide(object):
         pass
     slide = FakeSlide()
     slide.spTree = test_shape_elements.empty_spTree
     return _SlideShapeTree(slide)
コード例 #26
0
 def textbox_sp_fixture(self, slide_, x_, y_, cx_, cy_, spTree_,
                        _next_shape_id_, id_, sp_):
     shapes = _SlideShapeTree(slide_)
     name = 'TextBox 41'
     return shapes, x_, y_, cx_, cy_, spTree_, id_, name, sp_
コード例 #27
0
ファイル: test_slide.py プロジェクト: eduvant/python-pptx
 def index_fixture(self, slide_, shape_):
     shapes = _SlideShapeTree(slide_)
     expected_idx = 1
     return shapes, shape_, expected_idx
コード例 #28
0
ファイル: test_slide.py プロジェクト: eduvant/python-pptx
 def no_title_fixture(self, slide_, spTree_, sp_):
     shapes = _SlideShapeTree(slide_)
     spTree_.iter_shape_elms.return_value = [sp_, sp_]
     return shapes
コード例 #29
0
 def graphicFrame_fixture(self, slide_, rows_, cols_, x_, y_, cx_, cy_,
                          spTree_, _next_shape_id_, id_, graphicFrame_):
     shapes = _SlideShapeTree(slide_)
     name = 'Table 41'
     return (shapes, rows_, cols_, x_, y_, cx_, cy_, spTree_, id_, name,
             graphicFrame_)
コード例 #30
0
 def image_part_fixture(self, slide_, image_file_, image_part_, rId_):
     shapes = _SlideShapeTree(slide_)
     return shapes, image_file_, slide_, image_part_, rId_
コード例 #31
0
 def add_chart_fixture(self, slide_, chart_type_, chart_data_, rId_,
                       _add_chart_graphic_frame_, graphic_frame_):
     shape_tree = _SlideShapeTree(slide_)
     x, y, cx, cy = 1, 2, 3, 4
     return (shape_tree, chart_type_, x, y, cx, cy, chart_data_, rId_,
             graphic_frame_)
コード例 #32
0
 def no_title_fixture(self, slide_, spTree_, sp_):
     shapes = _SlideShapeTree(slide_)
     spTree_.iter_shape_elms.return_value = [sp_, sp_]
     return shapes
コード例 #33
0
ファイル: test_slide.py プロジェクト: eduvant/python-pptx
 def factory_fixture(
         self, ph_elm_, _SlideShapeFactory_, slide_placeholder_):
     shapes = _SlideShapeTree(None)
     _SlideShapeFactory_.return_value = slide_placeholder_
     return shapes, ph_elm_, _SlideShapeFactory_, slide_placeholder_
コード例 #34
0
 def pic_fixture(self, slide_, image_part_, rId_, x_, y_, cx_, cy_, spTree_,
                 _next_shape_id_, id_, name, desc_, scaled_cx_, scaled_cy_,
                 pic_):
     shapes = _SlideShapeTree(slide_)
     return (shapes, image_part_, rId_, x_, y_, cx_, cy_, spTree_, id_,
             name, desc_, scaled_cx_, scaled_cy_, pic_)
コード例 #35
0
ファイル: test_slide.py プロジェクト: eduvant/python-pptx
 def textbox_sp_fixture(
         self, slide_, x_, y_, cx_, cy_, spTree_, _next_shape_id_,
         id_, sp_):
     shapes = _SlideShapeTree(slide_)
     name = 'TextBox 41'
     return shapes, x_, y_, cx_, cy_, spTree_, id_, name, sp_
コード例 #36
0
 def sp_fixture(self, slide_, autoshape_type_, x_, y_, cx_, cy_, spTree_,
                _next_shape_id_, id_, prst_, sp_):
     shapes = _SlideShapeTree(slide_)
     name = 'Foobar 41'
     return (shapes, autoshape_type_, x_, y_, cx_, cy_, spTree_, id_, name,
             prst_, sp_)
コード例 #37
0
ファイル: test_slide.py プロジェクト: eduvant/python-pptx
 def title_fixture(self, slide_, sp_2_, _shape_factory_, shape_):
     shapes = _SlideShapeTree(slide_)
     _shape_factory_.return_value = shape_
     title_placeholder_ = shape_
     return shapes, _shape_factory_, sp_2_, title_placeholder_
コード例 #38
0
 def textbox_fixture(self, x_, y_, cx_, cy_, _add_textbox_sp_,
                     _shape_factory_, sp_, textbox_):
     shapes = _SlideShapeTree(None)
     _shape_factory_.return_value = textbox_
     return (shapes, x_, y_, cx_, cy_, _add_textbox_sp_, _shape_factory_,
             sp_, textbox_)
コード例 #39
0
    def shapes(self):
        """
		Instance of |SlideShapeTree| containing sequence of shape objects
		appearing on this slide.
		"""
        return _SlideShapeTree(self)
コード例 #40
0
 def title_fixture(self, slide_, sp_2_, _shape_factory_, shape_):
     shapes = _SlideShapeTree(slide_)
     _shape_factory_.return_value = shape_
     title_placeholder_ = shape_
     return shapes, _shape_factory_, sp_2_, title_placeholder_
コード例 #41
0
ファイル: test_slide.py プロジェクト: pjbayes/python-pptx
 def image_part_fixture(self, slide_, image_file_, image_part_, rId_):
     shapes = _SlideShapeTree(slide_)
     return shapes, image_file_, slide_, image_part_, rId_