本文整理匯總了Python中paste.response.HeaderDict.fromlist方法的典型用法代碼示例。如果您正苦於以下問題:Python HeaderDict.fromlist方法的具體用法?Python HeaderDict.fromlist怎麽用?Python HeaderDict.fromlist使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類paste.response.HeaderDict
的用法示例。
在下文中一共展示了HeaderDict.fromlist方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: repl_start_response
# 需要導入模塊: from paste.response import HeaderDict [as 別名]
# 或者: from paste.response.HeaderDict import fromlist [as 別名]
def repl_start_response(status, headers, exc_info=None):
response = pylons.response._current_obj()
start_response_called.append(None)
# Copy the headers from the global response
# XXX: TODO: This should really be done with a more efficient
# header merging function at some point.
if log_debug:
log.debug("Merging pylons.response headers into "
"start_response call, status: %s", status)
response.headers.update(HeaderDict.fromlist(headers))
headers = response.headers.headeritems()
for c in pylons.response.cookies.values():
headers.append(('Set-Cookie', c.output(header='')))
return start_response(status, headers, exc_info)