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

Class _BaseDrawingOperation

src/pptx/shapes/freeform.py:250–283  ·  view source on GitHub ↗

Base class for freeform drawing operations. A drawing operation has at least one location (x, y) in local coordinates.

Source from the content-addressed store, hash-verified

248
249
250class _BaseDrawingOperation(object):
251 """Base class for freeform drawing operations.
252
253 A drawing operation has at least one location (x, y) in local coordinates.
254 """
255
256 def __init__(self, freeform_builder: FreeformBuilder, x: Length, y: Length):
257 super(_BaseDrawingOperation, self).__init__()
258 self._freeform_builder = freeform_builder
259 self._x = x
260 self._y = y
261
262 def apply_operation_to(self, path: CT_Path2D) -> CT_DrawingOperation:
263 """Add the XML element(s) implementing this operation to `path`.
264
265 Must be implemented by each subclass.
266 """
267 raise NotImplementedError("must be implemented by each subclass")
268
269 @property
270 def x(self) -> Length:
271 """Return the horizontal (x) target location of this operation.
272
273 The returned value is an integer in local coordinates.
274 """
275 return self._x
276
277 @property
278 def y(self) -> Length:
279 """Return the vertical (y) target location of this operation.
280
281 The returned value is an integer in local coordinates.
282 """
283 return self._y
284
285
286class _Close(object):

Callers 4

dx_fixtureMethod · 0.90
dy_fixtureMethod · 0.90
x_fixtureMethod · 0.90
y_fixtureMethod · 0.90

Calls

no outgoing calls

Tested by 4

dx_fixtureMethod · 0.72
dy_fixtureMethod · 0.72
x_fixtureMethod · 0.72
y_fixtureMethod · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…