server/hook.py
changeset 8666 1dd655788ece
parent 8626 e2ba137b2bf9
child 8694 d901c36bcfce
equal deleted inserted replaced
8665:e65af61bde7d 8666:1dd655788ece
   256 
   256 
   257 from logilab.common.decorators import classproperty, cached
   257 from logilab.common.decorators import classproperty, cached
   258 from logilab.common.deprecation import deprecated, class_renamed
   258 from logilab.common.deprecation import deprecated, class_renamed
   259 from logilab.common.logging_ext import set_log_methods
   259 from logilab.common.logging_ext import set_log_methods
   260 from logilab.common.registry import (Predicate, NotPredicate, OrPredicate,
   260 from logilab.common.registry import (Predicate, NotPredicate, OrPredicate,
   261                                      classid, objectify_predicate, yes)
   261                                      objectify_predicate, yes)
   262 
   262 
   263 from cubicweb import RegistryNotFound, server
   263 from cubicweb import RegistryNotFound, server
   264 from cubicweb.cwvreg import CWRegistry, CWRegistryStore
   264 from cubicweb.cwvreg import CWRegistry, CWRegistryStore
   265 from cubicweb.predicates import ExpectedValuePredicate, is_instance
   265 from cubicweb.predicates import ExpectedValuePredicate, is_instance
   266 from cubicweb.appobject import AppObject
   266 from cubicweb.appobject import AppObject
   766 
   766 
   767     def handle_event(self, event):
   767     def handle_event(self, event):
   768         """delegate event handling to the opertaion"""
   768         """delegate event handling to the opertaion"""
   769         if event == 'postcommit_event' and hasattr(self, 'commit_event'):
   769         if event == 'postcommit_event' and hasattr(self, 'commit_event'):
   770             warn('[3.10] %s: commit_event method has been replaced by postcommit_event'
   770             warn('[3.10] %s: commit_event method has been replaced by postcommit_event'
   771                  % classid(self.__class__), DeprecationWarning)
   771                  % self.__class__, DeprecationWarning)
   772             self.commit_event() # pylint: disable=E1101
   772             self.commit_event() # pylint: disable=E1101
   773         getattr(self, event)()
   773         getattr(self, event)()
   774 
   774 
   775     def precommit_event(self):
   775     def precommit_event(self):
   776         """the observed connections set is preparing a commit"""
   776         """the observed connections set is preparing a commit"""