本文整理匯總了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