当前位置: 首页>>代码示例>>Python>>正文


Python HTTPRequest.processInputs方法代码示例

本文整理汇总了Python中ZPublisher.HTTPRequest.HTTPRequest.processInputs方法的典型用法代码示例。如果您正苦于以下问题:Python HTTPRequest.processInputs方法的具体用法?Python HTTPRequest.processInputs怎么用?Python HTTPRequest.processInputs使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ZPublisher.HTTPRequest.HTTPRequest的用法示例。


在下文中一共展示了HTTPRequest.processInputs方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: decodeQueryString

# 需要导入模块: from ZPublisher.HTTPRequest import HTTPRequest [as 别名]
# 或者: from ZPublisher.HTTPRequest.HTTPRequest import processInputs [as 别名]
def decodeQueryString(QueryString):
  """decode *QueryString* into a dictionary, as ZPublisher would do"""
  r= HTTPRequest(None,
         {'QUERY_STRING' : QueryString,
          'SERVER_URL' : '',
          },
         None,1)
  r.processInputs()
  return r.form
开发者ID:Doap,项目名称:plone.app.cmsui,代码行数:11,代码来源:fileupload.py

示例2: testRemoveStdinReferences

# 需要导入模块: from ZPublisher.HTTPRequest import HTTPRequest [as 别名]
# 或者: from ZPublisher.HTTPRequest.HTTPRequest import processInputs [as 别名]
 def testRemoveStdinReferences(self):
     # Verifies that all references to the input stream go away on
     # request.close().  Otherwise a tempfile may stick around.
     import sys
     from StringIO import StringIO
     s = StringIO(TEST_FILE_DATA)
     env = TEST_ENVIRON.copy()
     start_count = sys.getrefcount(s)
     from ZPublisher.HTTPRequest import HTTPRequest
     req = HTTPRequest(s, env, None)
     req.processInputs()
     self.assertNotEqual(start_count, sys.getrefcount(s))  # Precondition
     req.close()
     self.assertEqual(start_count, sys.getrefcount(s))  # The test
开发者ID:wpjunior,项目名称:proled,代码行数:16,代码来源:testHTTPRequest.py

示例3: testFileIterator

# 需要导入模块: from ZPublisher.HTTPRequest import HTTPRequest [as 别名]
# 或者: from ZPublisher.HTTPRequest.HTTPRequest import processInputs [as 别名]
 def testFileIterator(self):
     # checks fileupload object supports the iterator protocol
     # collector entry 1837
     import sys
     from StringIO import StringIO
     s = StringIO(TEST_FILE_DATA)
     env = TEST_ENVIRON.copy()
     from ZPublisher.HTTPRequest import HTTPRequest
     req = HTTPRequest(s, env, None)
     req.processInputs()
     f=req.form.get('file')
     self.assertEqual(list(f),['test\n'])
     f.seek(0)
     self.assertEqual(f.next(),'test\n')
     f.seek(0)
     self.assertEqual(f.xreadlines(),f)
开发者ID:wpjunior,项目名称:proled,代码行数:18,代码来源:testHTTPRequest.py

示例4: makerequest

# 需要导入模块: from ZPublisher.HTTPRequest import HTTPRequest [as 别名]
# 或者: from ZPublisher.HTTPRequest.HTTPRequest import processInputs [as 别名]
def makerequest(environ=None, stdin=''):
  stdout = StringIO()
  stdin  = StringIO(stdin)
  if environ is None:
    environ = {}

  # Header-Name -> HEADER_NAME
  _ = {}
  for k,v in environ.items():
    k = k.replace('-', '_').upper()
    _[k] = v
  environ = _

  response = HTTPResponse(stdout=stdout)
  environ.setdefault('SERVER_NAME',    'foo')
  environ.setdefault('SERVER_PORT',    '80')
  request  = HTTPRequest(stdin, environ, response)
  # process stdin data
  request.processInputs()
  return request
开发者ID:Nexedi,项目名称:erp5,代码行数:22,代码来源:test.erp5.testBigFile.py

示例5: makeFileUpload

# 需要导入模块: from ZPublisher.HTTPRequest import HTTPRequest [as 别名]
# 或者: from ZPublisher.HTTPRequest.HTTPRequest import processInputs [as 别名]
def makeFileUpload(data, filename):
    request_data = upload_request.format(filename, len(data), data)
    req = HTTPRequest(StringIO(request_data), test_environment.copy(), None)
    req.processInputs()
    return req.form.get('file')
开发者ID:,项目名称:,代码行数:7,代码来源:


注:本文中的ZPublisher.HTTPRequest.HTTPRequest.processInputs方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。