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

Method typesetString

Lib/pagebot/base/typesetter.py:595–603  ·  view source on GitHub ↗

If s is a formatted string, then it is placed untouched. If it is a plain string, then use the optional *style* or element *e* (using *e.css(name)*) for searching style parameters. Answer the new formatted string. Used e.g. to measure its size.

(self, sOrBs, e=None, style=None)

Source from the content-addressed store, hash-verified

593 self.htmlNode(node, end=True)
594
595 def typesetString(self, sOrBs, e=None, style=None):
596 """If s is a formatted string, then it is placed untouched. If it is a
597 plain string, then use the optional *style* or element *e* (using
598 *e.css(name)*) for searching style parameters. Answer the new
599 formatted string. Used e.g. to measure its size."""
600 # Only convert if not yet BabelString instance.
601 bs = self.context.newString(sOrBs, e=e, style=style)
602 self.append(bs)
603 return bs
604
605 def typesetNode(self, node, e=None):
606 """Recursively typeset the etree *node*, using a reference to element

Callers

nothing calls this directly

Calls 2

appendMethod · 0.95
newStringMethod · 0.80

Tested by

no test coverage detected