server/session.py
changeset 6147 95c604ec89bf
parent 6142 8bc6eac1fac1
child 6401 d7f5d873e1b8
--- a/server/session.py	Wed Aug 25 18:13:05 2010 +0200
+++ b/server/session.py	Wed Aug 25 18:29:55 2010 +0200
@@ -64,6 +64,14 @@
 
     If mode is session.`HOOKS_ALLOW_ALL`, given hooks categories will
     be disabled.
+
+    .. sourcecode:: python
+
+       with hooks_control(self.session, self.session.HOOKS_ALLOW_ALL, 'integrity'):
+           # ... do stuff with all but 'integrity' hooks activated
+
+       with hooks_control(self.session, self.session.HOOKS_DENY_ALL, 'integrity'):
+           # ... do stuff with none but 'integrity' hooks activated
     """
     def __init__(self, session, mode, *categories):
         self.session = session