Input a string and validate that it contains the names of one or more valid renderers separated on '+' characters. If valid, return a list of the renderer names Parameters ---------- renderers_string: str Returns ------- lis
(self, renderers_string)
| 219 | ] |
| 220 | |
| 221 | def _validate_coerce_renderers(self, renderers_string): |
| 222 | """ |
| 223 | Input a string and validate that it contains the names of one or more |
| 224 | valid renderers separated on '+' characters. If valid, return |
| 225 | a list of the renderer names |
| 226 | |
| 227 | Parameters |
| 228 | ---------- |
| 229 | renderers_string: str |
| 230 | |
| 231 | Returns |
| 232 | ------- |
| 233 | list of str |
| 234 | """ |
| 235 | # Validate value |
| 236 | if not isinstance(renderers_string, str): |
| 237 | raise ValueError("Renderer must be specified as a string") |
| 238 | |
| 239 | renderer_names = renderers_string.split("+") |
| 240 | invalid = [name for name in renderer_names if name not in self] |
| 241 | if invalid: |
| 242 | raise ValueError( |
| 243 | """ |
| 244 | Invalid named renderer(s) received: {}""".format(str(invalid)) |
| 245 | ) |
| 246 | |
| 247 | return renderer_names |
| 248 | |
| 249 | def __repr__(self): |
| 250 | return """\ |
no test coverage detected