(self, spec, on_embed=None)
| 63 | pass |
| 64 | |
| 65 | def __init__(self, spec, on_embed=None): |
| 66 | self.processed = False |
| 67 | self.on_embed = on_embed or (lambda d: d) |
| 68 | try: |
| 69 | self.spec = type(self).dump_dict(spec) # this may raise TypeError |
| 70 | except TypeError: |
| 71 | self.processed = True |
| 72 | type(self).safely_destruct(spec) |
| 73 | raise |
| 74 | |
| 75 | # For Context manager |
| 76 | self.enabled_context_manager = False |
| 77 | self.container_selector = None |
| 78 | self.container_dom_id = None # todo: this name is ambiguous, rename it to `scope_name` or others |
| 79 | self.after_exit = None |
| 80 | |
| 81 | # Try to make sure current session exist. |
| 82 | # If we leave the session interaction in `Output.__del__`, |
| 83 | # the Exception raised from there will be ignored by python interpreter, |
| 84 | # thus we can't end some session in some cases. |
| 85 | # See also: https://github.com/pywebio/PyWebIO/issues/243 |
| 86 | get_current_session() |
| 87 | |
| 88 | def enable_context_manager(self, container_selector=None, container_dom_id=None, after_exit=None): |
| 89 | self.enabled_context_manager = True |
nothing calls this directly
no test coverage detected