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

Method asBabelString

Lib/pagebot/contexts/basecontext/basecontext.py:806–814  ·  view source on GitHub ↗

Converts another string based class to BabelString.

(self, s, style=None)

Source from the content-addressed store, hash-verified

804 # Babelstring
805
806 def asBabelString(self, s, style=None):
807 """Converts another string based class to BabelString."""
808 if isinstance(s, str):
809 # Creates a new string with default styles.
810 style = makeStyle(style=style)
811 bs = self.newString(s, style=style)
812 return bs
813 else:
814 raise PageBotFileFormatError('type is %s' % type(bs))
815
816 # ...
817

Callers 1

drawStringMethod · 0.95

Calls 3

newStringMethod · 0.95
makeStyleFunction · 0.90

Tested by

no test coverage detected