本文整理汇总了Python中SkunkWeb.Configuration.trim方法的典型用法代码示例。如果您正苦于以下问题:Python Configuration.trim方法的具体用法?Python Configuration.trim怎么用?Python Configuration.trim使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SkunkWeb.Configuration
的用法示例。
在下文中一共展示了Configuration.trim方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _processRequest
# 需要导入模块: from SkunkWeb import Configuration [as 别名]
# 或者: from SkunkWeb.Configuration import trim [as 别名]
def _processRequest(requestData, sessionDict):
"""
request handling functioning for requestHandler's
HandleRequest hook.
"""
response=None
# DEBUG(WEB, 'creating Connection')
# DEBUG(WEB, 'requestData is %s' % str(requestData))
connection=HTTPConnection(requestData)
sessionDict[constants.CONNECTION]=connection
sessionDict[constants.HOST]=connection.host
sessionDict[constants.LOCATION]=connection.uri
sessionDict[constants.SERVER_PORT]=int(connection.env['SERVER_PORT'])
try:
# DEBUG(WEB, 'executing HaveConnection hook')
HaveConnection(Configuration.job, connection, sessionDict)
# DEBUG(WEB, 'survived HaveConnection hook')
# overlay of config information
Configuration.trim()
Configuration.scope(sessionDict)
#Configuration.saveMash()
# DEBUG(WEB, 'executing PreHandleConnection hook')
PreHandleConnection(Configuration.job, connection, sessionDict)
except PreemptiveResponse, pr:
# DEBUG(WEB, 'got preemptive response')
response=pr.responseData
示例2: _cleanupConfig
# 需要导入模块: from SkunkWeb import Configuration [as 别名]
# 或者: from SkunkWeb.Configuration import trim [as 别名]
def _cleanupConfig(requestData, sessionDict):
"""
function for requestHandler's CleanupRequest hook
"""
if sessionDict.has_key(constants.HOST):
del sessionDict[constants.HOST]
if sessionDict.has_key(constants.LOCATION):
del sessionDict[constants.LOCATION]
Configuration.trim()
if sessionDict.has_key(constants.IP):
Configuration.scope({constants.IP : sessionDict[constants.IP],
constants.PORT: sessionDict[constants.PORT]})
elif sessionDict.has_key(constants.UNIXPATH):
Configuration.scope({constants.UNIXPATH : sessionDict[constants.UNIXPATH]})
示例3: _endSession
# 需要导入模块: from SkunkWeb import Configuration [as 别名]
# 或者: from SkunkWeb.Configuration import trim [as 别名]
def _endSession(sessionDict):
try:
EndSession(Configuration.job, sessionDict)
except:
logException()
Configuration.trim()
示例4: SIGALRMHandler
# 需要导入模块: from SkunkWeb import Configuration [as 别名]
# 或者: from SkunkWeb.Configuration import trim [as 别名]
def SIGALRMHandler(*args):
Configuration.trim()
ERROR('Throwing timeout exception')
signal.alarm(1) # in case they catch this exception
raise DocumentTimeout, "timeout reached"
示例5: SIGALRMHandler
# 需要导入模块: from SkunkWeb import Configuration [as 别名]
# 或者: from SkunkWeb.Configuration import trim [as 别名]
def SIGALRMHandler(*args):
Configuration.trim()
raise DocumentTimeout, "timeout reached"