Commit 72830b1
authored
Resolves the genuinely-missing surface of the issue #18 epic and adds
issue-named convenience API over the sub-features this fork already
shipped. One branch; nine sub-features.
Investigation finding (recorded so the delta is auditable): issue #18 is
written against upstream scanny/python-pptx, which is behind this fork.
Arrowhead ends (full MSO_LINE_END_TYPE enum + LineFormat.begin/end_
arrowhead_* + oxml + 42 tests) and the experimental connector connect
API were ALREADY shipped here; for those, scope was verify-no-regression
plus thin issue-named aliases, not a rebuild.
New (genuinely missing):
- ShadowFormat.glow_effect / .reflection_effect / .soft_edge_effect —
CT_GlowEffect / CT_ReflectionEffect / CT_SoftEdgesEffect mirroring the
proven a:outerShdw pattern; wired into CT_EffectList in ECMA-376
schema order (blur,fillOverlay,glow,innerShdw,outerShdw,prstShdw,
reflection,softEdge). softEdge/@RaD is RequiredAttribute per schema;
glow always emits its mandatory EG_ColorChoice child.
- Shape.scene_3d / Shape.shape_3d — CT_Scene3D / CT_Camera / CT_LightRig
/ CT_Shape3D. scene3d default emits BOTH the schema-required camera
AND lightRig (camera-only → PowerPoint repair). Wired into spPr after
effectLst, before extLst.
- Shape.flip_horizontal / Shape.flip_vertical — delegate to the existing
oxml flipH/flipV (creates a:xfrm in schema-safe order).
- Shape.duplicate(insert_at_z=None) — deep-copy with sequential unique
cNvPr id reassignment (max_shape_id+1+i, so a duplicated *group*'s
children don't collide → no repair) and unique name; z-clamped so the
clone never lands before grpSpPr. Pure-XML copy; relationship-backed
shapes share the part (documented limitation).
- Shape.slide_left/_top/_width/_height — additive, read-only world-space
coordinates composing every enclosing p:grpSp affine outward (one
recursion handles arbitrary nesting); identity fallback on degenerate
chExt; never mutates stored xfrm; existing left/top semantics
unchanged. Group rotation/flip intentionally not folded (matches COM
Shape.Left).
Issue-named aliases over shipped API (additive, no signature change):
- LineFormat.head_end / .tail_end (.type/.width/.length)
- Connector.start_connection / .end_connection
Tests: 38 new unit tests in tests/test_issue18_shape_effects.py
(glow 4, reflection 4, soft-edge 4, 3-D 4, head/tail 3, start/end 2,
group-coords 5, flip 4, duplicate 8) + 10 behave scenarios in
features/iss-18-shape-effects.feature. Per-class save→reopen round-trip
coverage included.
Trinity (verbatim):
python3 -m pytest tests/ -q -> 3925 passed (3887 + 38)
ruff check src tests -> All checks passed!
python3 -m behave features/ --no-color -> 1119 scenarios, 0 failed
(1109 + 10)
UAT: uat/uat_issue18_shape_effects.py runs clean, 16/16 round-trip
checks, exit 0. Interceptor screenshots of slides 1/2/4 in real
PowerPoint show glow/reflection/soft-edge, a 3-D extruded box, and a
flipped+duplicated arrow rendering with NO repair dialog
(sheets_on_w1=0). Visual sign-off is the maintainer's call per §6a —
not claimed here.
Closes #18
1 parent d4a821c commit 72830b1
13 files changed
Lines changed: 1552 additions & 3 deletions
File tree
- features
- steps
- src/pptx
- dml
- oxml
- dml
- shapes
- shapes
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
0 commit comments