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


Python History.removeHistoryListener方法代碼示例

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


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

示例1: _set_history_listener

# 需要導入模塊: from pyjamas import History [as 別名]
# 或者: from pyjamas.History import removeHistoryListener [as 別名]
    def _set_history_listener(self, on, on_period=251):
        '''
        pyjamas/library/pyjamas/History.py is checking every 250ms if URL has changed
        
        By default, BuoyService checks every 250+1ms before turning its listener back on.
        An initial call in BuoyService() set-up needs to set on_period to 1 for immediate listening

        Rapid UI-interaction can lead to multiple nested calls.
        A count is kept to control when to add/remove the sole history listener.
        If a count wasn't kept then History will wobble
        '''
        if on:
            self.timer = Timer(on_period, self)
        else:
            if self.timer_count == 1:
                History.removeHistoryListener(self)
            self.timer_count -= 1
開發者ID:anandology,項目名稱:pyjamas,代碼行數:19,代碼來源:buoy.py


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