(self)
| 107 | web.ctx.app_stack.append(self) |
| 108 | |
| 109 | def _unload(self): |
| 110 | web.ctx.app_stack = web.ctx.app_stack[:-1] |
| 111 | |
| 112 | if web.ctx.app_stack: |
| 113 | # this is a sub-application, revert ctx to earlier state. |
| 114 | oldctx = web.ctx.get("_oldctx") |
| 115 | if oldctx: |
| 116 | web.ctx.home = oldctx.home |
| 117 | web.ctx.homepath = oldctx.homepath |
| 118 | web.ctx.path = oldctx.path |
| 119 | web.ctx.fullpath = oldctx.fullpath |
| 120 | |
| 121 | def _cleanup(self): |
| 122 | # Threads can be recycled by WSGI servers. |