| 2161 | self.transforms.append(transform_class) |
| 2162 | |
| 2163 | def _load_ui_methods(self, methods: Any) -> None: |
| 2164 | if isinstance(methods, types.ModuleType): |
| 2165 | self._load_ui_methods(dict((n, getattr(methods, n)) for n in dir(methods))) |
| 2166 | elif isinstance(methods, list): |
| 2167 | for m in methods: |
| 2168 | self._load_ui_methods(m) |
| 2169 | else: |
| 2170 | for name, fn in methods.items(): |
| 2171 | if ( |
| 2172 | not name.startswith("_") |
| 2173 | and hasattr(fn, "__call__") |
| 2174 | and name[0].lower() == name[0] |
| 2175 | ): |
| 2176 | self.ui_methods[name] = fn |
| 2177 | |
| 2178 | def _load_ui_modules(self, modules: Any) -> None: |
| 2179 | if isinstance(modules, types.ModuleType): |