Пример #1
0
 def _getPosthooks(self, apiName):
     """
     @param apiName: name of api method to get posthooks for.
     @return: modifiable list all posthooks attached to api method with
     name C{apiName}.
     """
     try:
         return self._posthooks[apiName]
     except KeyError:
         raise errors.InvalidAPIMethodError(apiName)
Пример #2
0
 def _installPosthook(self, apiName, hookFunction):
     """
     Installs a posthook for a particular method.
     @param apiName: name of the function to install the posthook for
     @param hookFunction: function to call before calling apiName.
     See handle.installPosthook for description of the required
     hookFunction signature.
     """
     try:
         self._posthooks[apiName].append(hookFunction)
     except KeyError:
         raise errors.InvalidAPIMethodError(apiName)