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

Method importCss

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

Import a chunk of UTF-8 CSS code from the path.

(self, path)

Source from the content-addressed store, hash-verified

418 return len(self._cssOut)
419
420 def importCss(self, path):
421 """Import a chunk of UTF-8 CSS code from the path."""
422 if os.path.exists(path):
423 f = codecs.open(path, 'r', 'utf-8')
424 self.addCss(f.read())
425 f.close()
426 else:
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."""

Callers 1

XXXbuild_scssMethod · 0.80

Calls 3

addCssMethod · 0.95
commentMethod · 0.95
openMethod · 0.45

Tested by

no test coverage detected