本文整理汇总了Python中depot.manager.DepotManager.set_middleware方法的典型用法代码示例。如果您正苦于以下问题:Python DepotManager.set_middleware方法的具体用法?Python DepotManager.set_middleware怎么用?Python DepotManager.set_middleware使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类depot.manager.DepotManager
的用法示例。
在下文中一共展示了DepotManager.set_middleware方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from depot.manager import DepotManager [as 别名]
# 或者: from depot.manager.DepotManager import set_middleware [as 别名]
def __init__(self, handler: Optional[Callable], registry: Registry) -> None:
"""
:param handler: Downstream tween or main Pyramid request handler (Kotti)
:type handler: function
:param registry: Application registry
:type registry: :class:`pyramid.registry.Registry`
"""
self.mountpoint = registry.settings["kotti.depot_mountpoint"]
self.handler = handler
self.registry = registry
DepotManager.set_middleware(self)
示例2: __init__
# 需要导入模块: from depot.manager import DepotManager [as 别名]
# 或者: from depot.manager.DepotManager import set_middleware [as 别名]
def __init__(self, handler, registry):
"""
:param handler: Downstream tween or main Pyramid request handler (Kotti)
:type handler: function
:param registry: Application registry
:type registry: :class:`pyramid.registry.Registry`
"""
self.mountpoint = registry.settings['kotti.depot_mountpoint']
self.handler = handler
self.registry = registry
self.cache_max_age = 3600 * 24 * 7
self.replace_wsgi_filewrapper = True
DepotManager.set_middleware(self)