(self, v)
| 2367 | return desc |
| 2368 | |
| 2369 | def validate_coerce(self, v): |
| 2370 | if v is None: |
| 2371 | pass |
| 2372 | elif isinstance(v, str): |
| 2373 | # Future possibilities: |
| 2374 | # - Detect filesystem system paths and convert to URI |
| 2375 | # - Validate either url or data uri |
| 2376 | pass |
| 2377 | elif self._PIL and isinstance(v, self._PIL.Image.Image): |
| 2378 | # Convert PIL image to png data uri string |
| 2379 | v = self.pil_image_to_uri(v) |
| 2380 | else: |
| 2381 | self.raise_invalid_val(v) |
| 2382 | |
| 2383 | return v |
| 2384 | |
| 2385 | @staticmethod |
| 2386 | def pil_image_to_uri(v): |
nothing calls this directly
no test coverage detected