Fixed old calls to tickerhandler from the tutorial_world. Also added a better error when this happens. This resolves #952.
This commit is contained in:
parent
910d539d45
commit
cce87a8399
3 changed files with 16 additions and 4 deletions
|
|
@ -435,6 +435,10 @@ class TickerHandler(object):
|
|||
when wanting to modify/remove the ticker later.
|
||||
|
||||
"""
|
||||
if isinstance(callback, int):
|
||||
raise RuntimeError("TICKER_HANDLER.add has changed: "
|
||||
"the interval is now the first argument, callback the second.")
|
||||
|
||||
obj, path, callfunc = self._get_callback(callback)
|
||||
store_key = self._store_key(obj, path, interval, callfunc, idstring, persistent)
|
||||
self.ticker_storage[store_key] = (args, kwargs)
|
||||
|
|
@ -455,6 +459,10 @@ class TickerHandler(object):
|
|||
idstring (str, optional): Identifier id of ticker to remove.
|
||||
|
||||
"""
|
||||
if isinstance(callback, int):
|
||||
raise RuntimeError("TICKER_HANDLER.remove has changed: "
|
||||
"the interval is now the first argument, callback the second.")
|
||||
|
||||
obj, path, callfunc = self._get_callback(callback)
|
||||
store_key = self._store_key(obj, path, interval, callfunc, idstring, persistent)
|
||||
to_remove = self.ticker_storage.pop(store_key, None)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue