Show More
@@ -183,6 +183,9 b' def _catchterm(*args):' | |||||
183 | # retrieving configuration value. |
|
183 | # retrieving configuration value. | |
184 | _unset = object() |
|
184 | _unset = object() | |
185 |
|
185 | |||
|
186 | # _reqexithandlers: callbacks run at the end of a request | |||
|
187 | _reqexithandlers = [] | |||
|
188 | ||||
186 | class ui(object): |
|
189 | class ui(object): | |
187 | def __init__(self, src=None): |
|
190 | def __init__(self, src=None): | |
188 | """Create a fresh new ui object if no src given |
|
191 | """Create a fresh new ui object if no src given | |
@@ -193,8 +196,6 b' class ui(object):' | |||||
193 | """ |
|
196 | """ | |
194 | # _buffers: used for temporary capture of output |
|
197 | # _buffers: used for temporary capture of output | |
195 | self._buffers = [] |
|
198 | self._buffers = [] | |
196 | # _exithandlers: callbacks run at the end of a request |
|
|||
197 | self._exithandlers = [] |
|
|||
198 | # 3-tuple describing how each buffer in the stack behaves. |
|
199 | # 3-tuple describing how each buffer in the stack behaves. | |
199 | # Values are (capture stderr, capture subprocesses, apply labels). |
|
200 | # Values are (capture stderr, capture subprocesses, apply labels). | |
200 | self._bufferstates = [] |
|
201 | self._bufferstates = [] | |
@@ -220,7 +221,6 b' class ui(object):' | |||||
220 | self._styles = {} |
|
221 | self._styles = {} | |
221 |
|
222 | |||
222 | if src: |
|
223 | if src: | |
223 | self._exithandlers = src._exithandlers |
|
|||
224 | self.fout = src.fout |
|
224 | self.fout = src.fout | |
225 | self.ferr = src.ferr |
|
225 | self.ferr = src.ferr | |
226 | self.fin = src.fin |
|
226 | self.fin = src.fin | |
@@ -1098,6 +1098,10 b' class ui(object):' | |||||
1098 |
|
1098 | |||
1099 | return True |
|
1099 | return True | |
1100 |
|
1100 | |||
|
1101 | @property | |||
|
1102 | def _exithandlers(self): | |||
|
1103 | return _reqexithandlers | |||
|
1104 | ||||
1101 | def atexit(self, func, *args, **kwargs): |
|
1105 | def atexit(self, func, *args, **kwargs): | |
1102 | '''register a function to run after dispatching a request |
|
1106 | '''register a function to run after dispatching a request | |
1103 |
|
1107 |
General Comments 0
You need to be logged in to leave comments.
Login now