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

Method prepare

Lib/pagebot/elements/image.py:415–423  ·  view source on GitHub ↗

Respond to the top-down element broadcast to prepare for build. If the original image needs scaling, then prepare the build by letting the context make a new cache file with the scaled images. If the cache file already exists, then ignore, just continue the broadcast towards

(self, view)

Source from the content-addressed store, hash-verified

413 e.build_inds(view, p2D)
414
415 def prepare(self, view):
416 """Respond to the top-down element broadcast to prepare for build. If
417 the original image needs scaling, then prepare the build by letting the
418 context make a new cache file with the scaled images. If the cache
419 file already exists, then ignore, just continue the broadcast towards
420 the child elements."""
421 self._scaleImage(view)
422 for e in self.elements:
423 e.prepare(view)
424
425 def build(self, view, origin=ORIGIN, **kwargs):
426 """Draw the image in the calculated (w, h). Because we need to use the

Callers 1

buildMethod · 0.45

Calls 1

_scaleImageMethod · 0.95

Tested by

no test coverage detected