MCPcopy Create free account
hub / github.com/EasyIME/PIME / render_linked_css

Method render_linked_css

python/python3/tornado/web.py:960–980  ·  view source on GitHub ↗

Default method used to render the final css links for the rendered webpage. Override this method in a sub-classed controller to change the output.

(self, css_files: Iterable[str])

Source from the content-addressed store, hash-verified

958 )
959
960 def render_linked_css(self, css_files: Iterable[str]) -> str:
961 """Default method used to render the final css links for the
962 rendered webpage.
963
964 Override this method in a sub-classed controller to change the output.
965 """
966 paths = []
967 unique_paths = set() # type: Set[str]
968
969 for path in css_files:
970 if not is_absolute(path):
971 path = self.static_url(path)
972 if path not in unique_paths:
973 paths.append(path)
974 unique_paths.add(path)
975
976 return "".join(
977 '<link href="' + escape.xhtml_escape(p) + '" '
978 'type="text/css" rel="stylesheet"/>'
979 for p in paths
980 )
981
982 def render_embed_css(self, css_embed: Iterable[bytes]) -> bytes:
983 """Default method used to render the final embedded css for the

Callers 1

renderMethod · 0.95

Calls 5

static_urlMethod · 0.95
is_absoluteFunction · 0.85
joinMethod · 0.80
appendMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected