當前位置: 首頁>>代碼示例>>Python>>正文


Python CallHistory.from_board_number_and_calls_string方法代碼示例

本文整理匯總了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)
開發者ID:pdm55,項目名稱:saycbridge,代碼行數:21,代碼來源:board.py


注:本文中的core.callhistory.CallHistory.from_board_number_and_calls_string方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。