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


Python events.Events方法代碼示例

本文整理匯總了Python中events.Events方法的典型用法代碼示例。如果您正苦於以下問題:Python events.Events方法的具體用法?Python events.Events怎麽用?Python events.Events使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在events的用法示例。


在下文中一共展示了events.Events方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: __init__

# 需要導入模塊: import events [as 別名]
# 或者: from events import Events [as 別名]
def __init__(self):
        self.events = Events() 
開發者ID:dantezhu,項目名稱:haven,代碼行數:4,代碼來源:mixins.py

示例2: __init__

# 需要導入模塊: import events [as 別名]
# 或者: from events import Events [as 別名]
def __init__(self, url=None, retry_timeout=None, max_retries=None):
        super(OrderBook, self).__init__(url, retry_timeout, max_retries)
        self._on_ping = Events()
        self._on_ping.on_change += self.on_ping
        self.order_nounces = {}
        self.order_books = {} 
開發者ID:slazarov,項目名稱:python-bittrex-websocket,代碼行數:8,代碼來源:order_book.py

示例3: _assign_callbacks

# 需要導入模塊: import events [as 別名]
# 或者: from events import Events [as 別名]
def _assign_callbacks(self):
        self._on_public_callback = Events()
        self._on_public_callback.on_change += self.on_public
        self._on_private_callback = Events()
        self._on_private_callback.on_change += self.on_private 
開發者ID:slazarov,項目名稱:python-bittrex-websocket,代碼行數:7,代碼來源:websocket_client.py

示例4: __init__

# 需要導入模塊: import events [as 別名]
# 或者: from events import Events [as 別名]
def __init__(
        self,
        accounts=None,
        markets=None,
        objects=None,
        on_tx=None,
        on_object=None,
        on_block=None,
        on_account=None,
        on_market=None,
        keep_alive=25,
        **kwargs
    ):
        # Events
        super(Notify, self).__init__()
        self.events = Events()

        # BitShares instance
        BlockchainInstance.__init__(self, **kwargs)

        # Callbacks
        if on_tx:
            self.on_tx += on_tx
        if on_object:
            self.on_object += on_object
        if on_block:
            self.on_block += on_block
        if on_account:
            self.on_account += on_account
        if on_market:
            self.on_market += on_market

        # Open the websocket
        self.websocket = BitSharesWebsocket(
            urls=self.blockchain.rpc.urls,
            user=self.blockchain.rpc.user,
            password=self.blockchain.rpc.password,
            accounts=accounts,
            markets=self.get_market_ids(markets),
            objects=objects,
            on_tx=on_tx,
            on_object=on_object,
            on_block=on_block,
            on_account=self.process_account,
            on_market=self.process_market,
            keep_alive=keep_alive,
        ) 
開發者ID:bitshares,項目名稱:python-bitshares,代碼行數:49,代碼來源:notify.py


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