@@ -8,25 +8,6 @@ class PluginValidationError(Exception):
8
8
""" plugin failed validation. """
9
9
10
10
11
- class _TracedHookExecution (object ):
12
- def __init__ (self , pluginmanager , before , after ):
13
- self .pluginmanager = pluginmanager
14
- self .before = before
15
- self .after = after
16
- self .oldcall = pluginmanager ._inner_hookexec
17
- assert not isinstance (self .oldcall , _TracedHookExecution )
18
- self .pluginmanager ._inner_hookexec = self
19
-
20
- def __call__ (self , hook , hook_impls , kwargs ):
21
- self .before (hook .name , hook_impls , kwargs )
22
- outcome = _Result .from_call (lambda : self .oldcall (hook , hook_impls , kwargs ))
23
- self .after (outcome , hook .name , hook_impls , kwargs )
24
- return outcome .get_result ()
25
-
26
- def undo (self ):
27
- self .pluginmanager ._inner_hookexec = self .oldcall
28
-
29
-
30
11
class PluginManager (object ):
31
12
""" Core Pluginmanager class which manages registration
32
13
of plugin objects and 1:N hook calling.
@@ -271,7 +252,7 @@ def add_hookcall_monitoring(self, before, after):
271
252
same arguments as ``before`` but also a :py:class:`_Result`` object
272
253
which represents the result of the overall hook call.
273
254
"""
274
- return _TracedHookExecution (self , before , after ).undo
255
+ return _tracing . _TracedHookExecution (self , before , after ).undo
275
256
276
257
def enable_tracing (self ):
277
258
""" enable tracing of hook calls and return an undo function. """
0 commit comments