| 89 | return f"{type(self).__qualname__}({self._path!r})" |
| 90 | |
| 91 | def render(self, *, attrs=None): |
| 92 | if ( |
| 93 | attrs |
| 94 | and self.attributes |
| 95 | and (conflicts := attrs.keys() & self.attributes.keys()) |
| 96 | ): |
| 97 | conflicts = ", ".join(sorted(conflicts)) |
| 98 | raise ValueError( |
| 99 | f"{self.__class__.__qualname__} has conflicting attributes: " |
| 100 | f"{conflicts}" |
| 101 | ) |
| 102 | return format_html( |
| 103 | self.element_template, |
| 104 | path=self.path, |
| 105 | attributes=flatatt({**(attrs or {}), **self.attributes}), |
| 106 | ) |
| 107 | |
| 108 | @property |
| 109 | def path(self): |