equal
deleted
inserted
replaced
62 If mode is session.`HOOKS_DENY_ALL`, given hooks categories will |
62 If mode is session.`HOOKS_DENY_ALL`, given hooks categories will |
63 be enabled. |
63 be enabled. |
64 |
64 |
65 If mode is session.`HOOKS_ALLOW_ALL`, given hooks categories will |
65 If mode is session.`HOOKS_ALLOW_ALL`, given hooks categories will |
66 be disabled. |
66 be disabled. |
|
67 |
|
68 .. sourcecode:: python |
|
69 |
|
70 with hooks_control(self.session, self.session.HOOKS_ALLOW_ALL, 'integrity'): |
|
71 # ... do stuff with all but 'integrity' hooks activated |
|
72 |
|
73 with hooks_control(self.session, self.session.HOOKS_DENY_ALL, 'integrity'): |
|
74 # ... do stuff with none but 'integrity' hooks activated |
67 """ |
75 """ |
68 def __init__(self, session, mode, *categories): |
76 def __init__(self, session, mode, *categories): |
69 self.session = session |
77 self.session = session |
70 self.mode = mode |
78 self.mode = mode |
71 self.categories = categories |
79 self.categories = categories |