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

Method shape_filter

utils/src/presentation.py:1069–1086  ·  view source on GitHub ↗

Filter shapes in the slide by type. Args: shape_type (type): The type of shapes to filter. shapes (list[ShapeElement]): The shapes to filter. Yields: ShapeElement: The filtered shapes.

(self, shape_type: type, shapes: list[ShapeElement] = None)

Source from the content-addressed store, hash-verified

1067 return slide
1068
1069 def shape_filter(self, shape_type: type, shapes: list[ShapeElement] = None):
1070 """
1071 Filter shapes in the slide by type.
1072
1073 Args:
1074 shape_type (type): The type of shapes to filter.
1075 shapes (list[ShapeElement]): The shapes to filter.
1076
1077 Yields:
1078 ShapeElement: The filtered shapes.
1079 """
1080 if shapes is None:
1081 shapes = self.shapes
1082 for shape in shapes:
1083 if isinstance(shape, shape_type):
1084 yield shape
1085 elif isinstance(shape, GroupShape):
1086 yield from self.shape_filter(shape_type, shape.data)
1087
1088 def get_content_type(self):
1089 """

Callers 7

__init__Method · 0.95
get_content_typeMethod · 0.95
to_textMethod · 0.95
apply_statsMethod · 0.45
collect_imagesMethod · 0.45
eval_generalFunction · 0.45
filter_slideFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected