本文整理汇总了Python中ZPublisher.HTTPRequest.HTTPRequest.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python HTTPRequest.__init__方法的具体用法?Python HTTPRequest.__init__怎么用?Python HTTPRequest.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ZPublisher.HTTPRequest.HTTPRequest
的用法示例。
在下文中一共展示了HTTPRequest.__init__方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from ZPublisher.HTTPRequest import HTTPRequest [as 别名]
# 或者: from ZPublisher.HTTPRequest.HTTPRequest import __init__ [as 别名]
def __init__(self, path, command, channel, response, stdin=None,
environ=None, globbing=None, recursive=0, size=None):
# we need to store the globbing information to pass it
# to the ZPublisher and the manage_FTPlist function
# (ajung)
self.globbing = globbing
self.recursive = recursive
if stdin is None:
size = 0
stdin = StringIO()
if environ is None:
environ = self._get_env(path, command, channel, stdin, size)
self._orig_env = environ
HTTPRequest.__init__(self, stdin, environ, response, clean=1)
# support for cookies and cookie authentication
self.cookies = channel.cookies
if '__ac' not in self.cookies and channel.userid != 'anonymous':
self.other['__ac_name'] = channel.userid
self.other['__ac_password'] = channel.password
for k, v in self.cookies.items():
if k not in self.other:
self.other[k] = v
示例2: __init__
# 需要导入模块: from ZPublisher.HTTPRequest import HTTPRequest [as 别名]
# 或者: from ZPublisher.HTTPRequest.HTTPRequest import __init__ [as 别名]
def __init__(self,language=None):
resp = HTTPResponse(stdout=sys.stdout)
environ={}
environ['SERVER_NAME']='foo'
environ['SERVER_PORT']='80'
environ['REQUEST_METHOD'] = 'GET'
environ['SCRIPT_NAME']='/foo/test'
environ['SESSION']=None
self.SESSION={}
HTTPRequest.__init__(self,None,environ,resp)
if language: self.setLanguage(language)
示例3: __init__
# 需要导入模块: from ZPublisher.HTTPRequest import HTTPRequest [as 别名]
# 或者: from ZPublisher.HTTPRequest.HTTPRequest import __init__ [as 别名]
def __init__(self, response, interval):
stdin=StringIO()
environ=self._get_env(stdin)
HTTPRequest.__init__(self, stdin, environ, response, clean=1)
self.other['interval'] = interval