Lazy namespace which creates UIModule proxies bound to a handler.
| 3359 | |
| 3360 | |
| 3361 | class _UIModuleNamespace(object): |
| 3362 | """Lazy namespace which creates UIModule proxies bound to a handler.""" |
| 3363 | |
| 3364 | def __init__( |
| 3365 | self, handler: RequestHandler, ui_modules: Dict[str, Type[UIModule]] |
| 3366 | ) -> None: |
| 3367 | self.handler = handler |
| 3368 | self.ui_modules = ui_modules |
| 3369 | |
| 3370 | def __getitem__(self, key: str) -> Callable[..., str]: |
| 3371 | return self.handler._ui_module(key, self.ui_modules[key]) |
| 3372 | |
| 3373 | def __getattr__(self, key: str) -> Callable[..., str]: |
| 3374 | try: |
| 3375 | return self[key] |
| 3376 | except KeyError as e: |
| 3377 | raise AttributeError(str(e)) |
| 3378 | |
| 3379 | |
| 3380 | def create_signed_value( |