def trigger_watches(self):
to_remove = []<EOL>for uid, callback in self.watches.items():<EOL><INDENT>try:<EOL><INDENT>callback(self)<EOL><DEDENT>except Exception as e:<EOL><INDENT>Log.error("<STR_LIT>" + str(e))<EOL>Log.debug(traceback.format_exc())<EOL>to_remove.append(uid)<EOL><DEDENT><DEDENT>for uid in to_remove:<EOL><INDENT>self.unregister_watch(uid)<EOL><DEDENT>
Call all the callbacks.
If any callback raises an Exception,
unregister the corresponding watch.