teardown_appcontext()
来源:互联网 发布:在虚拟机上配置nginx 编辑:程序博客网 时间:2024/05/18 03:04
@setupmethod
def teardown_appcontext(self, f):
"""Registers a function to be called when the application context
ends. These functions are typically also called when the request
context is popped.
Example::
ctx = app.app_context()
ctx.push()
...
ctx.pop()
When ``ctx.pop()`` is executed in the above example, the teardown
functions are called just before the app context moves from the
stack of active contexts. This becomes relevant if you are using
such constructs in tests.
Since a request context typically also manages an application
context it would also be called when you pop a request context.
When a teardown function was called because of an exception it will
be passed an error object.
.. versionadded:: 0.9
"""
self.teardown_appcontext_funcs.append(f)
def teardown_appcontext(self, f):
"""Registers a function to be called when the application context
ends. These functions are typically also called when the request
context is popped.
Example::
ctx = app.app_context()
ctx.push()
...
ctx.pop()
When ``ctx.pop()`` is executed in the above example, the teardown
functions are called just before the app context moves from the
stack of active contexts. This becomes relevant if you are using
such constructs in tests.
Since a request context typically also manages an application
context it would also be called when you pop a request context.
When a teardown function was called because of an exception it will
be passed an error object.
.. versionadded:: 0.9
"""
self.teardown_appcontext_funcs.append(f)
return f
谷歌翻译结果:
“”注册函数时被调用的应用程序上下文
结束。这些功能通常也被称为请求时
弹出上下文。
例如::
CTX= app.app_context()
(ctx.push)
...
(ctx.pop)
当`` ctx.pop()``在上面的例子中,执行拆机
函数被调用之前从移动应用程序上下文
堆叠活性上下文。如果您正在使用,这将成为相关
这样的结构测试。
因为请求上下文通常还管理一个应用程序
情况下,它也被称为当你弹出一个请求上下文。
因为异常会被称为当拆卸功能
传递一个错误对象。
.. versionadded::0.9
“”“
大概意思应该是你把一个东西加入到context,那么工作完成后你就要把它释放掉。
- teardown_appcontext()
- :(:)
- :)
- :)
- ()
- )))))))))))))
- fput(); fgetc();
- gluLookAt() gluPerspective()
- (转)ioctl()
- getch(),getchar()
- call()、apply()。
- call(),apply()
- ((void*)-1)
- rand()&srand()
- fork()&vfork()
- avcodec_send_packet()/ avcodec_receive_frame()
- 答辩通过啦!:)))))
- 我答辩的过程:)))
- 最流行的Java制作报表的工具
- 微创业怎么样:微创业是否是以后的潮流?
- 数据库完整性
- 黑马程序员—C#系列 (二)
- jquery插件之表单验证插件
- teardown_appcontext()
- magento安装好之后后台登陆不进去的解决方法
- Java + jsf 实现 仿百度 全拼 简拼 汉字智能补全
- 从决策树学习谈到贝叶斯分类算法、EM、HMM
- 实现WebServices二:使用XFireSpringServlet与ServiceBean
- Ubuntu GCC 编译C++ 文件出错。main.o: In function `__static_initialization_and_destruction_0':
- CTLChart振动信号图形库编写历程
- git
- Openfire 的安装和配置