本文整理匯總了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