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

Method writeHtml

Lib/pagebot/contexts/htmlcontext/htmlbuilder.py:608–615  ·  view source on GitHub ↗

Write the collected set of html chunks to path.

(self, path)

Source from the content-addressed store, hash-verified

606 self.comment('Cannot find HTML file "%s"' % path)
607
608 def writeHtml(self, path):
609 """Write the collected set of html chunks to path."""
610 try:
611 f = codecs.open(path, 'w', 'utf-8')
612 f.write(self.getHtml())
613 f.close()
614 except IOError:
615 print('### Cannot write HTML file "%s"' % path)
616
617 def getHtml(self):
618 """Answers the accumulated HTML as single string."""

Callers 1

build_htmlMethod · 0.80

Calls 3

getHtmlMethod · 0.95
writeMethod · 0.80
openMethod · 0.45

Tested by

no test coverage detected