MCPcopy Create free account
hub / github.com/scanny/python-pptx / address

Method address

src/pptx/action.py:209–228  ·  view source on GitHub ↗

Read/write. The URL of the hyperlink. URL can be on http, https, mailto, or file scheme; others may work. Returns |None| if no hyperlink is defined, including when another action such as `RUN_MACRO` is defined on the object. Assigning |None| removes any action defined on the

(self)

Source from the content-addressed store, hash-verified

207
208 @property
209 def address(self) -> str | None:
210 """Read/write. The URL of the hyperlink.
211
212 URL can be on http, https, mailto, or file scheme; others may work. Returns |None| if no
213 hyperlink is defined, including when another action such as `RUN_MACRO` is defined on the
214 object. Assigning |None| removes any action defined on the object, whether it is a hyperlink
215 action or not.
216 """
217 hlink = self._hlink
218
219 # there's no URL if there's no click action
220 if hlink is None:
221 return None
222
223 # a click action without a relationship has no URL
224 rId = hlink.rId
225 if not rId:
226 return None
227
228 return self.part.target_ref(rId)
229
230 @address.setter
231 def address(self, url: str | None):

Callers

nothing calls this directly

Calls 4

_remove_hlinkMethod · 0.95
_get_or_add_hlinkMethod · 0.95
relate_toMethod · 0.80
target_refMethod · 0.45

Tested by

no test coverage detected