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_)
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
def empty_shape_collection(self): class FakeSlide(object): pass slide = FakeSlide() slide.spTree = test_shape_elements.empty_spTree return _SlideShapeTree(slide)
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_)
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_)
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_ )
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_)
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
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_ )
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_ )
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_ )
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_ )
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_ )
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_ )
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_ )
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_)
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_ )
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_ )
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_ )
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)
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 )
def factory_fixture(self, ph_elm_, _SlideShapeFactory_, slide_placeholder_): shapes = _SlideShapeTree(None) _SlideShapeFactory_.return_value = slide_placeholder_ return shapes, ph_elm_, _SlideShapeFactory_, slide_placeholder_
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_)
def index_fixture(self, slide_, shape_): shapes = _SlideShapeTree(slide_) expected_idx = 1 return shapes, shape_, expected_idx
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_
def no_title_fixture(self, slide_, spTree_, sp_): shapes = _SlideShapeTree(slide_) spTree_.iter_shape_elms.return_value = [sp_, sp_] return shapes
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_)
def image_part_fixture(self, slide_, image_file_, image_part_, rId_): shapes = _SlideShapeTree(slide_) return shapes, image_file_, slide_, image_part_, rId_
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_)
def factory_fixture( self, ph_elm_, _SlideShapeFactory_, slide_placeholder_): shapes = _SlideShapeTree(None) _SlideShapeFactory_.return_value = slide_placeholder_ return shapes, ph_elm_, _SlideShapeFactory_, slide_placeholder_
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_)
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_
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_)
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_
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_)
def shapes(self): """ Instance of |SlideShapeTree| containing sequence of shape objects appearing on this slide. """ return _SlideShapeTree(self)