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

Method _get_pt

Lib/pagebot/toolbox/units.py:499–516  ·  view source on GitHub ↗

Answers the value in *pt*. Base value for absolute unit values is ignored. >>> p(1).pt 12 >>> pt(1), pt(1).pt # Render value cast to pt (1pt, 1) >>> 10 + inch(1).pt + 8 # Rendered to a pt-units, so 10 and 8 behave as pt numbers. 90 >>>

(self)

Source from the content-addressed store, hash-verified

497 return dict(class_=self.__class__.__name__, v=self.v, base=asNormalizedJSON(self.base), g=self.g)
498
499 def _get_pt(self):
500 """Answers the value in *pt*. Base value for absolute unit
501 values is ignored.
502
503 >>> p(1).pt
504 12
505 >>> pt(1), pt(1).pt # Render value cast to pt
506 (1pt, 1)
507 >>> 10 + inch(1).pt + 8 # Rendered to a pt-units, so 10 and 8 behave as pt numbers.
508 90
509 >>> (10 + inch(1) + 8).pt # Using reversed __radd__, then rendered and cast to pt-unit.
510 1368
511 >>> mm(1).pt
512 2.8346472
513 >>> inch(1).pt
514 72
515 """
516 return asIntOrFloat(self.rv * self.PT_FACTOR) # Factor to points
517 def _set_pt(self, v):
518 self.v = v / self.PT_FACTOR
519 pt = property(_get_pt, _set_pt)

Callers

nothing calls this directly

Calls 1

asIntOrFloatFunction · 0.90

Tested by

no test coverage detected