Beispiel #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_)
Beispiel #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
Beispiel #3
0
    def empty_shape_collection(self):
        class FakeSlide(object):
            pass

        slide = FakeSlide()
        slide.spTree = test_shape_elements.empty_spTree
        return _SlideShapeTree(slide)
Beispiel #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_)
Beispiel #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_)
Beispiel #6
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_
     )
Beispiel #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_)
Beispiel #8
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
Beispiel #9
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_
     )
Beispiel #10
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_
     )
Beispiel #11
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_
     )
Beispiel #12
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_
     )
Beispiel #13
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_
     )
Beispiel #14
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_
     )
Beispiel #15
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_
     )
Beispiel #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_)
Beispiel #17
0
 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_
     )
Beispiel #18
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_
     )
Beispiel #19
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_
     )
Beispiel #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)
Beispiel #21
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
     )
Beispiel #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_
Beispiel #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_)
Beispiel #24
0
 def index_fixture(self, slide_, shape_):
     shapes = _SlideShapeTree(slide_)
     expected_idx = 1
     return shapes, shape_, expected_idx
Beispiel #25
0
 def empty_shape_collection(self):
     class FakeSlide(object):
         pass
     slide = FakeSlide()
     slide.spTree = test_shape_elements.empty_spTree
     return _SlideShapeTree(slide)
Beispiel #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_
Beispiel #27
0
 def index_fixture(self, slide_, shape_):
     shapes = _SlideShapeTree(slide_)
     expected_idx = 1
     return shapes, shape_, expected_idx
Beispiel #28
0
 def no_title_fixture(self, slide_, spTree_, sp_):
     shapes = _SlideShapeTree(slide_)
     spTree_.iter_shape_elms.return_value = [sp_, sp_]
     return shapes
Beispiel #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_)
Beispiel #30
0
 def image_part_fixture(self, slide_, image_file_, image_part_, rId_):
     shapes = _SlideShapeTree(slide_)
     return shapes, image_file_, slide_, image_part_, rId_
Beispiel #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_)
Beispiel #32
0
 def no_title_fixture(self, slide_, spTree_, sp_):
     shapes = _SlideShapeTree(slide_)
     spTree_.iter_shape_elms.return_value = [sp_, sp_]
     return shapes
Beispiel #33
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_
Beispiel #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_)
Beispiel #35
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_
Beispiel #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_)
Beispiel #37
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_
Beispiel #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_)
Beispiel #39
0
    def shapes(self):
        """
		Instance of |SlideShapeTree| containing sequence of shape objects
		appearing on this slide.
		"""
        return _SlideShapeTree(self)
Beispiel #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_
Beispiel #41
0
 def image_part_fixture(self, slide_, image_file_, image_part_, rId_):
     shapes = _SlideShapeTree(slide_)
     return shapes, image_file_, slide_, image_part_, rId_