本文整理匯總了Python中core.callhistory.CallHistory.from_board_number_and_calls_string方法的典型用法代碼示例。如果您正苦於以下問題:Python CallHistory.from_board_number_and_calls_string方法的具體用法?Python CallHistory.from_board_number_and_calls_string怎麽用?Python CallHistory.from_board_number_and_calls_string使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類core.callhistory.CallHistory
的用法示例。
在下文中一共展示了CallHistory.from_board_number_and_calls_string方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: from_identifier
# 需要導入模塊: from core.callhistory import CallHistory [as 別名]
# 或者: from core.callhistory.CallHistory import from_board_number_and_calls_string [as 別名]
def from_identifier(self, identifier):
components = identifier.split("-")
if len(components) == 2:
(board_number_string, deal_and_history_identifier) = components
if ':' in deal_and_history_identifier:
deal_identifier, call_history_identifier = deal_and_history_identifier.split(':')
# We have to do a bit of a dance to convert from the board url system that
# the JS code uses to the one the python uses.
call_history = CallHistory.from_board_number_and_calls_string(int(board_number_string), call_history_identifier)
else:
deal_identifier = deal_and_history_identifier
call_history = CallHistory.empty_for_board_number(int(board_number_string))
else:
(board_number_string, deal_identifier, call_history_identifier) = components
call_history = CallHistory.from_identifier(call_history_identifier)
board_number = int(board_number_string)
deal = Deal.from_identifier(deal_identifier)
return Board(number=board_number, deal=deal, call_history=call_history)