(cls)
| 2397 | """ |
| 2398 | |
| 2399 | def __init_subclass__(cls): |
| 2400 | # Automatically perform docstring interpolation on the subclasses: |
| 2401 | # This allows listing the supported styles via |
| 2402 | # - %(BoxStyle:table)s |
| 2403 | # - %(ConnectionStyle:table)s |
| 2404 | # - %(ArrowStyle:table)s |
| 2405 | # and additionally adding .. ACCEPTS: blocks via |
| 2406 | # - %(BoxStyle:table_and_accepts)s |
| 2407 | # - %(ConnectionStyle:table_and_accepts)s |
| 2408 | # - %(ArrowStyle:table_and_accepts)s |
| 2409 | _docstring.interpd.register(**{ |
| 2410 | f"{cls.__name__}:table": cls.pprint_styles(), |
| 2411 | f"{cls.__name__}:table_and_accepts": ( |
| 2412 | cls.pprint_styles() |
| 2413 | + "\n\n .. ACCEPTS: [" |
| 2414 | + "|".join(map(" '{}' ".format, cls._style_list)) |
| 2415 | + "]") |
| 2416 | }) |
| 2417 | |
| 2418 | def __new__(cls, stylename, **kwargs): |
| 2419 | """Return the instance of the subclass with the given style name.""" |
nothing calls this directly
no test coverage detected