Get the help string for this class in ReST format. If `inst` is given, its current trait values will be used in place of class defaults.
(cls, inst: HasTraits | None = None)
| 249 | |
| 250 | @classmethod |
| 251 | def class_get_help(cls, inst: HasTraits | None = None) -> str: |
| 252 | """Get the help string for this class in ReST format. |
| 253 | |
| 254 | If `inst` is given, its current trait values will be used in place of |
| 255 | class defaults. |
| 256 | """ |
| 257 | assert inst is None or isinstance(inst, cls) |
| 258 | final_help = [] |
| 259 | base_classes = ", ".join(p.__name__ for p in cls.__bases__) |
| 260 | final_help.append(f"{cls.__name__}({base_classes}) options") |
| 261 | final_help.append(len(final_help[0]) * "-") |
| 262 | for _, v in sorted(cls.class_traits(config=True).items()): |
| 263 | help = cls.class_get_trait_help(v, inst) |
| 264 | final_help.append(help) |
| 265 | return "\n".join(final_help) |
| 266 | |
| 267 | @classmethod |
| 268 | def class_get_trait_help( |