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

Method prepare_html

Lib/pagebot/elements/image.py:353–362  ·  view source on GitHub ↗

Responds to the top-down element broadcast to prepare for build_html. If the original image needs scaling, then prepares 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

(self, view)

Source from the content-addressed store, hash-verified

351 )
352
353 def prepare_html(self, view):
354 """Responds to the top-down element broadcast to prepare for build_html.
355 If the original image needs scaling, then prepares the build by letting
356 the context make a new cache file with the scaled images. If the cache
357 file already exists, then ignore -- just continue the broadcast to the
358 child elements."""
359 self._scaleImage(view)
360
361 for e in self.elements:
362 e.prepare_html(view)
363
364 def build_html(self, view, path, **kwargs):
365 # Gets current context.

Callers

nothing calls this directly

Calls 1

_scaleImageMethod · 0.95

Tested by

no test coverage detected