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

Method append

Lib/pagebot/base/typesetter.py:552–569  ·  view source on GitHub ↗

Append the string (or BabelString instance) to the last textbox in galley, if it exists. Otherwise create a new Text and add it to self.galley.

(self, bs)

Source from the content-addressed store, hash-verified

550 return mergedStyle
551
552 def append(self, bs):
553 """Append the string (or BabelString instance) to the last textbox in
554 galley, if it exists. Otherwise create a new Text and add it to
555 self.galley."""
556 if self.galley.elements and self.galley.elements[-1].isText:
557 box = self.galley.elements[-1]
558 if box.bs is None:
559 box.bs = bs
560 else:
561 box.bs += bs
562 elif hasattr(bs, 's'):
563 s = bs.s
564 while s and s[0] in ' \t\n\r':
565 s = s[1:]
566 bs.s = s
567 self.TEXTBOX_CLASS(bs, parent=self.galley)
568 else:
569 self.TEXTBOX_CLASS(bs, parent=self.galley)
570
571 def htmlNode(self, node, end=False):
572 """Open the tag in HTML output and copy the node attributes if there are any."""

Callers 12

node_tabMethod · 0.95
node_brMethod · 0.95
node_ulMethod · 0.95
node_liMethod · 0.95
htmlNodeMethod · 0.95
_htmlNodeMethod · 0.95
typesetStringMethod · 0.95
typesetNodeMethod · 0.95
pushStyleMethod · 0.45
addHistoryMethod · 0.45
getMatchingStyleNamesMethod · 0.45
composeMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected