ps-python-pptx 1.2.0__py3-none-any.whl → 1.3.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
pptx/__init__.py CHANGED
@@ -26,7 +26,7 @@ from pptx.parts.slide import (
26
26
  if TYPE_CHECKING:
27
27
  from pptx.opc.package import Part
28
28
 
29
- __version__ = "1.2.0"
29
+ __version__ = "1.3.0"
30
30
 
31
31
  sys.modules["pptx.exceptions"] = exceptions
32
32
  del sys
pptx/action.py CHANGED
@@ -237,6 +237,29 @@ class Hyperlink(Subshape):
237
237
  hlink = self._get_or_add_hlink()
238
238
  hlink.rId = rId
239
239
 
240
+ @property
241
+ def screen_tip(self) -> str | None:
242
+ """Text shown by PowerPoint when pointing at this hyperlink.
243
+
244
+ Assign the address or action before setting a ScreenTip. Assigning None
245
+ or an empty string removes the tip without changing the link. Setting
246
+ a new address uses the existing address setter behavior and clears the
247
+ old tip. Reading this property does not create a hyperlink element.
248
+ """
249
+ hlink = self._hlink
250
+ return hlink.tooltip if hlink is not None else None
251
+
252
+ @screen_tip.setter
253
+ def screen_tip(self, value: str | None):
254
+ if value is not None and not isinstance(value, str):
255
+ raise TypeError("screen_tip must be a string or None")
256
+ hlink = self._hlink
257
+ if hlink is None:
258
+ if value:
259
+ raise ValueError("Set a hyperlink address or action before its ScreenTip")
260
+ return
261
+ hlink.tooltip = value or None
262
+
240
263
  def _get_or_add_hlink(self) -> CT_Hyperlink:
241
264
  """Get the `a:hlinkClick` or `a:hlinkHover` element for the Hyperlink object.
242
265
 
pptx/oxml/action.py CHANGED
@@ -14,6 +14,8 @@ class CT_Hyperlink(BaseOxmlElement):
14
14
  "action", XsdString
15
15
  )
16
16
 
17
+ tooltip: str | None = OptionalAttribute("tooltip", XsdString) # pyright: ignore[reportAssignmentType]
18
+
17
19
  @property
18
20
  def action_fields(self) -> dict[str, str]:
19
21
  """Query portion of the `ppaction://` URL as dict.
pptx/text/text.py CHANGED
@@ -488,6 +488,29 @@ class _Hyperlink(Subshape):
488
488
  if url:
489
489
  self._add_hlinkClick(url)
490
490
 
491
+ @property
492
+ def screen_tip(self) -> str | None:
493
+ """Text shown by PowerPoint when pointing at this hyperlink.
494
+
495
+ Assign the address or action before setting a ScreenTip. Assigning None
496
+ or an empty string removes the tip without changing the link. Setting
497
+ a new address uses the existing address setter behavior and clears the
498
+ old tip. Reading this property does not create a hyperlink element.
499
+ """
500
+ hlink = self._hlinkClick
501
+ return hlink.tooltip if hlink is not None else None
502
+
503
+ @screen_tip.setter
504
+ def screen_tip(self, value: str | None):
505
+ if value is not None and not isinstance(value, str):
506
+ raise TypeError("screen_tip must be a string or None")
507
+ hlink = self._hlinkClick
508
+ if hlink is None:
509
+ if value:
510
+ raise ValueError("Set a hyperlink address or action before its ScreenTip")
511
+ return
512
+ hlink.tooltip = value or None
513
+
491
514
  def _add_hlinkClick(self, url: str):
492
515
  rId = self.part.relate_to(url, RT.HYPERLINK, is_external=True)
493
516
  self._rPr.add_hlinkClick(rId)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ps-python-pptx
3
- Version: 1.2.0
3
+ Version: 1.3.0
4
4
  Summary: Python-pptx fork with public APIs for themes, backgrounds, lists, and rich text.
5
5
  Author-email: Steve Canny <stcanny@gmail.com>
6
6
  License: MIT
@@ -1,5 +1,5 @@
1
- pptx/__init__.py,sha256=OVJQ5p8HC3OgSKBarTUvWI58cFrKHFPQc32rD0Vft8A,2168
2
- pptx/action.py,sha256=NiaoG75EYyLemHYUkV5zNB93ZwS5A39uTY9I_K0P_b0,9638
1
+ pptx/__init__.py,sha256=27NcYHHKRAjL6gwwhRTPjktz_rkm-r4G8yD-zYFNn6I,2168
2
+ pptx/action.py,sha256=PuhHYNENNLNYgecril8rDJIERaJEyCb8kbPK4QdyKNM,10597
3
3
  pptx/api.py,sha256=IrGxa35Z6tyZBxaBuknyROdmHKNI8XUa77XU62xBFFM,1737
4
4
  pptx/background.py,sha256=1-YI6g_bOJppM_cuAhHEJXOaKTzh7endTaVOE-wAEaU,8732
5
5
  pptx/exc.py,sha256=5ahr42pL5ELGHFD0YFCAYp17YEm_DkXUymyt2ENFX_Q,473
@@ -50,7 +50,7 @@ pptx/opc/serialized.py,sha256=7iH3v3Ln95W26P1C0XYswvPONdwTp-hM_ld7QB5lXHQ,11437
50
50
  pptx/opc/shared.py,sha256=moVes6J3hp4BrXQTZfkoVJldxfr9LUzMtxhtl6nkYOw,709
51
51
  pptx/opc/spec.py,sha256=Adxgld3M-kTbWTwm27YNwPUPl7Ajh3anXTiwgYLbIDo,998
52
52
  pptx/oxml/__init__.py,sha256=m3tZMaKa9C7d-zm6NRQATenNq3uHPc65_DPeBOdPB24,15869
53
- pptx/oxml/action.py,sha256=XM8-gextGC6bTP4RCZHoDDfO-8qBaVpq6fuhSLjYhFA,1612
53
+ pptx/oxml/action.py,sha256=1hP_zInNiI_U0q7gqoWYOAS0tTYJhQfbJ68xW92gYIU,1720
54
54
  pptx/oxml/coreprops.py,sha256=Q32m6gMBqlH2WA7XtXBxD60vdWY1DEuFJQX2w8CjfFw,10419
55
55
  pptx/oxml/ns.py,sha256=En3N2dpK2eJb_E7w5korgxrYEDU_yFkHdpPR5eDkzLU,4761
56
56
  pptx/oxml/presentation.py,sha256=sh2DAaEg5PdIV3vXIeeX4RgJIALZ4UbRqDOF9hUFvV4,4252
@@ -110,9 +110,9 @@ pptx/templates/xlsx-icon.emf,sha256=FOUpNs698W5aZinOcHQVwmEi_lSvMihyotJf7GGKae4,
110
110
  pptx/text/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
111
111
  pptx/text/fonts.py,sha256=dvkIW1jTVR2PbsAblB-lNA0xYkp86VeUKJC6DOCbu3c,12863
112
112
  pptx/text/layout.py,sha256=bkZjiRmoIrFMlcmonoROfgfgrgLCc9BRXKiCkWwB7W0,10232
113
- pptx/text/text.py,sha256=IxVURbpxvWCfof7607RSJO2eJqwoX0bqLSY1Nfmoopg,28472
114
- ps_python_pptx-1.2.0.dist-info/licenses/LICENSE,sha256=dlLyceRtDVM-ncRj87X8vcrPTWqcjWtVTRXv0PN_YTI,1104
115
- ps_python_pptx-1.2.0.dist-info/METADATA,sha256=BQAW54v7YBwG5oDgVU0jC6oAkzN3G1NSEUQLuIJZfKc,3273
116
- ps_python_pptx-1.2.0.dist-info/WHEEL,sha256=YVMoNqKzERt-wjUZwJ33xBGAwnFl-4cqbYkTtWa4itE,91
117
- ps_python_pptx-1.2.0.dist-info/top_level.txt,sha256=O4BUPv9c3_6OQNtaneqNqq32Dp1TFyKK-K9CVNPenF8,5
118
- ps_python_pptx-1.2.0.dist-info/RECORD,,
113
+ pptx/text/text.py,sha256=7QW0zRa_pwnuJaT95Ip5fp0zAqmjH8wQRPKpP6avs18,29441
114
+ ps_python_pptx-1.3.0.dist-info/licenses/LICENSE,sha256=dlLyceRtDVM-ncRj87X8vcrPTWqcjWtVTRXv0PN_YTI,1104
115
+ ps_python_pptx-1.3.0.dist-info/METADATA,sha256=EaaZ4AHmoQPz4q3jQErrCVx--fBRigh_e8OuX-hXQzY,3273
116
+ ps_python_pptx-1.3.0.dist-info/WHEEL,sha256=YVMoNqKzERt-wjUZwJ33xBGAwnFl-4cqbYkTtWa4itE,91
117
+ ps_python_pptx-1.3.0.dist-info/top_level.txt,sha256=O4BUPv9c3_6OQNtaneqNqq32Dp1TFyKK-K9CVNPenF8,5
118
+ ps_python_pptx-1.3.0.dist-info/RECORD,,