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])
| 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 |
no test coverage detected