quantum源码分析2
来源:互联网 发布:淘宝怎样批量上传宝贝 编辑:程序博客网 时间:2024/06/05 16:23
[code=python]
class Controller(object):
"""WSGI app that dispatched to methods.
与Method对应的controller,上面说到,一个路由表会指定一个controller。
WSGI app that reads routing information supplied by RoutesMiddleware
and calls the requested action method upon itself. All action methods
must, in addition to their normal parameters, accept a 'req' argument
which is the incoming wsgi.Request. They raise a webob.exc exception,
or return a dict which will be serialized by requested content type.
"""
#装饰为一个WSGI应用
@webob.dec.wsgify(RequestClass=Request)
def __call__(self, req):
"""
Call the method specified in req.environ by RoutesMiddleware.
"""
arg_dict = req.environ['wsgiorg.routing_args'][1]
action = arg_dict['action']
method = getattr(self, action)
del arg_dict['controller']
del arg_dict['action']
if 'format' in arg_dict:
del arg_dict['format']
arg_dict['request'] = req
#执行方法,这里是一个抽象,子类继承后决定具体怎么执行
result = method(**arg_dict)
[/code]
class Controller(object):
"""WSGI app that dispatched to methods.
与Method对应的controller,上面说到,一个路由表会指定一个controller。
WSGI app that reads routing information supplied by RoutesMiddleware
and calls the requested action method upon itself. All action methods
must, in addition to their normal parameters, accept a 'req' argument
which is the incoming wsgi.Request. They raise a webob.exc exception,
or return a dict which will be serialized by requested content type.
"""
#装饰为一个WSGI应用
@webob.dec.wsgify(RequestClass=Request)
def __call__(self, req):
"""
Call the method specified in req.environ by RoutesMiddleware.
"""
arg_dict = req.environ['wsgiorg.routing_args'][1]
action = arg_dict['action']
method = getattr(self, action)
del arg_dict['controller']
del arg_dict['action']
if 'format' in arg_dict:
del arg_dict['format']
arg_dict['request'] = req
#执行方法,这里是一个抽象,子类继承后决定具体怎么执行
result = method(**arg_dict)
[/code]
- quantum源码分析2
- quantum源码分析
- quantum源码分析22
- Quantum
- Quantum的权限认证(2)
- 【OpenStack】OpenStack中的消息队列2--以Quantum为例
- 【OpenStack】OpenStack中的消息队列2--以Quantum为例
- 从0开始学习quantum之2:WSGI协议
- Quantum & r2q
- Quantum/ServiceInsertion
- quantum 配置
- Quantum Computers
- jboss4.2源码分析
- MTD源码分析(2)
- libhdfs源码分析(2)
- Leveldb源码分析--2
- x264 源码分析 (2)
- at91_sdcard源码分析(2)
- JSP如何防范SQL注入攻击
- 快速排序和插入排序混和使用
- 更改IRowSet的值
- HTML5 web workers
- 第五章 预工具链的创建
- quantum源码分析2
- Spring Security使用
- Qt小技巧
- C语言面试题汇总
- androidpn解析
- xheditor图片上传
- hdu2818(帶权并查集 待过)?
- quantum源码分析22
- python [Errno socket error] [Errno 104] Connection reset by peer