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