本文整理汇总了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)