MCPcopy Create free account
hub / github.com/Paper2Poster/Paper2Poster / from_shape

Method from_shape

utils/src/presentation.py:739–765  ·  view source on GitHub ↗
(
        cls,
        slide_idx: int,
        shape_idx: int,
        shape: PPTXGroupShape,
        style: dict,
        text_frame: TextFrame,
        config: Config,
        slide_area: float,
        level: int,
    )

Source from the content-addressed store, hash-verified

737class GroupShape(ShapeElement):
738 @classmethod
739 def from_shape(
740 cls,
741 slide_idx: int,
742 shape_idx: int,
743 shape: PPTXGroupShape,
744 style: dict,
745 text_frame: TextFrame,
746 config: Config,
747 slide_area: float,
748 level: int,
749 ):
750 data = [
751 ShapeElement.from_shape(
752 slide_idx,
753 (shape_idx + 1) * 100 + i,
754 sub_shape,
755 config,
756 slide_area,
757 level=level + 1,
758 )
759 for i, sub_shape in enumerate(shape.shapes)
760 ]
761 for idx, shape_bounds in enumerate(parse_groupshape(shape)):
762 data[idx].style["shape_bounds"] = shape_bounds
763 return cls(
764 slide_idx, shape_idx, style, data, text_frame, slide_area, level=level
765 )
766
767 def build(self, slide: PPTXSlide):
768 for shape in self.data:

Callers

nothing calls this directly

Calls 2

parse_groupshapeFunction · 0.90
from_shapeMethod · 0.45

Tested by

no test coverage detected