Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def _register_undo_handlers(self):
logger.debug("Registering undo handlers")
self.event_manager.subscribe(self.undo_create_event)
self.event_manager.subscribe(self.undo_delete_event)
self.event_manager.subscribe(self.undo_attribute_change_event)
self.event_manager.subscribe(self.undo_association_set_event)
self.event_manager.subscribe(self.undo_association_add_event)
self.event_manager.subscribe(self.undo_association_delete_event)
#
# Direct revert-statements from gaphas to the undomanager
state.observers.add(state.revert_handler)
state.subscribers.add(self._gaphas_undo_handler)
def _register_undo_handlers(self):
logger.debug("Registering undo handlers")
self.event_manager.subscribe(self.undo_create_event)
self.event_manager.subscribe(self.undo_delete_event)
self.event_manager.subscribe(self.undo_attribute_change_event)
self.event_manager.subscribe(self.undo_association_set_event)
self.event_manager.subscribe(self.undo_association_add_event)
self.event_manager.subscribe(self.undo_association_delete_event)
#
# Direct revert-statements from gaphas to the undomanager
state.observers.add(state.revert_handler)
state.subscribers.add(self._gaphas_undo_handler)
def _unregister_undo_handlers(self):
self.logger.debug('Unregistering undo handlers')
self.component_registry.unregister_handler(self.undo_create_event)
self.component_registry.unregister_handler(self.undo_delete_event)
self.component_registry.unregister_handler(self.undo_attribute_change_event)
self.component_registry.unregister_handler(self.undo_association_set_event)
self.component_registry.unregister_handler(self.undo_association_add_event)
self.component_registry.unregister_handler(self.undo_association_delete_event)
state.observers.discard(state.revert_handler)
state.subscribers.discard(self._gaphas_undo_handler)
self.add_undo_action(lambda: state.saveapply(*event));
self.add_undo_action(lambda: state.saveapply(*event))
def _unregister_undo_handlers(self):
self.logger.debug('Unregistering undo handlers')
self.component_registry.unregister_handler(self.undo_create_event)
self.component_registry.unregister_handler(self.undo_delete_event)
self.component_registry.unregister_handler(self.undo_attribute_change_event)
self.component_registry.unregister_handler(self.undo_association_set_event)
self.component_registry.unregister_handler(self.undo_association_add_event)
self.component_registry.unregister_handler(self.undo_association_delete_event)
state.observers.discard(state.revert_handler)
state.subscribers.discard(self._gaphas_undo_handler)
def _register_undo_handlers(self):
self.logger.debug('Registering undo handlers')
self.component_registry.register_handler(self.undo_create_event)
self.component_registry.register_handler(self.undo_delete_event)
self.component_registry.register_handler(self.undo_attribute_change_event)
self.component_registry.register_handler(self.undo_association_set_event)
self.component_registry.register_handler(self.undo_association_add_event)
self.component_registry.register_handler(self.undo_association_delete_event)
#
# Direct revert-statements from gaphas to the undomanager
state.observers.add(state.revert_handler)
state.subscribers.add(self._gaphas_undo_handler)