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

Method importJs

Lib/pagebot/contexts/htmlcontext/htmlbuilder.py:373–380  ·  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

371 return len(self._jsOut)
372
373 def importJs(self, path):
374 """Import a chunk of UTF-8 CSS code from the path."""
375 if os.path.exists(path):
376 f = codecs.open(path, 'r', 'utf-8')
377 self.addJs(f.read())
378 f.close()
379 else:
380 self.comment('Cannot find JS file "%s"' % path)
381
382 def copyPath(self, path):
383 """Collect path of files to copy to the output website."""

Callers

nothing calls this directly

Calls 3

addJsMethod · 0.95
commentMethod · 0.95
openMethod · 0.45

Tested by

no test coverage detected