MCPcopy Create free account
hub / github.com/PageBot/PageBot / _get_angle

Method _get_angle

Lib/pagebot/elements/element.py:2278–2293  ·  view source on GitHub ↗

Answers the rotation angle. >>> from pagebot.toolbox.units import degrees, radians >>> e = Element(angle=degrees(40)) >>> e.angle 40deg >>> e.angle = radians(0.4) + 0.25 >>> e.angle 0.65rad >>> e.angle = degrees(130) - radians(0.5)

(self)

Source from the content-addressed store, hash-verified

2276 return p
2277
2278 def _get_angle(self):
2279 """Answers the rotation angle.
2280
2281 >>> from pagebot.toolbox.units import degrees, radians
2282 >>> e = Element(angle=degrees(40))
2283 >>> e.angle
2284 40deg
2285 >>> e.angle = radians(0.4) + 0.25
2286 >>> e.angle
2287 0.65rad
2288 >>> e.angle = degrees(130) - radians(0.5)
2289 >>> e.angle
2290 40deg
2291 >>> e.angle = 30 # Degrees is default.
2292 """
2293 return self.style.get('angle', degrees(0))
2294
2295 def _set_angle(self, angle):
2296 if isinstance(angle, (int, float)):

Callers

nothing calls this directly

Calls 2

degreesFunction · 0.90
getMethod · 0.45

Tested by

no test coverage detected