tractatus/pptx-env/lib/python3.12/site-packages/pptx/shapes/group.py
TheFlow 2298d36bed fix(submissions): restructure Economist package and fix article display
- Create Economist SubmissionTracking package correctly:
  * mainArticle = full blog post content
  * coverLetter = 216-word SIR— letter
  * Links to blog post via blogPostId
- Archive 'Letter to The Economist' from blog posts (it's the cover letter)
- Fix date display on article cards (use published_at)
- Target publication already displaying via blue badge

Database changes:
- Make blogPostId optional in SubmissionTracking model
- Economist package ID: 68fa85ae49d4900e7f2ecd83
- Le Monde package ID: 68fa2abd2e6acd5691932150

Next: Enhanced modal with tabs, validation, export

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-24 08:47:42 +13:00

69 lines
2.2 KiB
Python

"""GroupShape and related objects."""
from __future__ import annotations
from typing import TYPE_CHECKING
from pptx.dml.effect import ShadowFormat
from pptx.enum.shapes import MSO_SHAPE_TYPE
from pptx.shapes.base import BaseShape
from pptx.util import lazyproperty
if TYPE_CHECKING:
from pptx.action import ActionSetting
from pptx.oxml.shapes.groupshape import CT_GroupShape
from pptx.shapes.shapetree import GroupShapes
from pptx.types import ProvidesPart
class GroupShape(BaseShape):
"""A shape that acts as a container for other shapes."""
def __init__(self, grpSp: CT_GroupShape, parent: ProvidesPart):
super().__init__(grpSp, parent)
self._grpSp = grpSp
@lazyproperty
def click_action(self) -> ActionSetting:
"""Unconditionally raises `TypeError`.
A group shape cannot have a click action or hover action.
"""
raise TypeError("a group shape cannot have a click action")
@property
def has_text_frame(self) -> bool:
"""Unconditionally |False|.
A group shape does not have a textframe and cannot itself contain text. This does not
impact the ability of shapes contained by the group to each have their own text.
"""
return False
@lazyproperty
def shadow(self) -> ShadowFormat:
"""|ShadowFormat| object representing shadow effect for this group.
A |ShadowFormat| object is always returned, even when no shadow is explicitly defined on
this group shape (i.e. when the group inherits its shadow behavior).
"""
return ShadowFormat(self._grpSp.grpSpPr)
@property
def shape_type(self) -> MSO_SHAPE_TYPE:
"""Member of :ref:`MsoShapeType` identifying the type of this shape.
Unconditionally `MSO_SHAPE_TYPE.GROUP` in this case
"""
return MSO_SHAPE_TYPE.GROUP
@lazyproperty
def shapes(self) -> GroupShapes:
"""|GroupShapes| object for this group.
The |GroupShapes| object provides access to the group's member shapes and provides methods
for adding new ones.
"""
from pptx.shapes.shapetree import GroupShapes
return GroupShapes(self._element, self)