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

Method writeCss

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

Write the collected set of CSS chunks to path.

(self, path, css=None)

Source from the content-addressed store, hash-verified

427 self.comment('Cannot find CSS file "%s"' % path)
428
429 def writeCss(self, path, css=None):
430 """Write the collected set of CSS chunks to path."""
431 try:
432 if css is None:
433 css = self.getCss()
434 f = codecs.open(path, 'w', 'utf-8')
435 f.write(css)
436 f.close()
437 except IOError:
438 print('[HtmlBuilder.writeCss] Cannot write CSS file "%s"' % path)
439
440 def headerCss(self, name):
441 """Add the CSS code to the header of the output page.

Callers 1

produceMethod · 0.80

Calls 3

getCssMethod · 0.95
writeMethod · 0.80
openMethod · 0.45

Tested by

no test coverage detected