You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to python-callbacks
Very cool piece of code. I was using it for a project and needed to
be able to remove a previously registered "permanent" callback at
anytime. Just thought I'd share in case anyone else need something
similar.
def ClearCallback(scope, name, callback):
try:
callback_map = _GetCallbackMap(scope)
callback_queue = callback_map[name]
for i in callback_queue.queue:
if callback is i[2].callback:
callback_queue.queue.remove(i)
if(len(callback_queue.queue) is 0):
ClearCallbacks(scope, name)
except KeyError:
pass