Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions pptx_blueprint/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,10 @@ def _find_shapes_in_slide(slide):

return matched_shapes

def _get_all_shapes(self) -> Iterable[BaseShape]:
all_shapes = [shape for slide in self._presentation.slides for shape in slide.shapes]
return all_shapes

def save(self, filename: _Pathlike) -> None:
"""Saves the updated pptx to the specified filepath.

Expand Down
5 changes: 5 additions & 0 deletions tests/test_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,8 @@ def test_find_shapes_from_one_slide(template):
def test_find_shapes_index_out_of_range(template):
with pytest.raises(IndexError):
shapes = template._find_shapes(0, 'logo')

def test_get_all_shapes(template):
shapes = template._get_all_shapes()
for shape in shapes:
assert str(shape.text) and str(shape.name)