本文整理汇总了Python中juliabox.interactive.SessContainer.is_valid_container方法的典型用法代码示例。如果您正苦于以下问题:Python SessContainer.is_valid_container方法的具体用法?Python SessContainer.is_valid_container怎么用?Python SessContainer.is_valid_container使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类juliabox.interactive.SessContainer
的用法示例。
在下文中一共展示了SessContainer.is_valid_container方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: is_valid_req
# 需要导入模块: from juliabox.interactive import SessContainer [as 别名]
# 或者: from juliabox.interactive.SessContainer import is_valid_container [as 别名]
def is_valid_req(self):
sessname = self.get_session_id()
if sessname is None:
return False
ports = self.get_ports()
container_ports = (ports[JBoxCookies.COOKIE_PORT_SHELL],
ports[JBoxCookies.COOKIE_PORT_UPL],
ports[JBoxCookies.COOKIE_PORT_IPNB])
if not SessContainer.is_valid_container("/" + sessname, container_ports):
self.log_info('not valid req. container deleted or ports not matching')
return False
return True
示例2: is_valid_req
# 需要导入模块: from juliabox.interactive import SessContainer [as 别名]
# 或者: from juliabox.interactive.SessContainer import is_valid_container [as 别名]
def is_valid_req(self):
sessname = self.get_session_id()
if sessname is None:
return False
ports = self.get_ports()
isvalid = True
if not ports or \
any(not ports.has_key(k) for k in [JBoxCookies.COOKIE_PORT_SHELL,
JBoxCookies.COOKIE_PORT_UPL,
JBoxCookies.COOKIE_PORT_IPNB]):
isvalid = False
else:
container_ports = (ports[JBoxCookies.COOKIE_PORT_SHELL],
ports[JBoxCookies.COOKIE_PORT_UPL],
ports[JBoxCookies.COOKIE_PORT_IPNB])
if not SessContainer.is_valid_container("/" + sessname, container_ports):
isvalid = False
if not isvalid:
self.log_info('Not valid request. Container deleted or ports not matching.')
return False
return True