author | Sylvain Thénault <sylvain.thenault@logilab.fr> |
Mon, 08 Feb 2010 09:57:25 +0100 | |
branch | stable |
changeset 4488 | e8e7f6a0e7b6 |
parent 4212 | ab6573088b4a |
child 4252 | 6c4f109c2b03 |
permissions | -rw-r--r-- |
1977
606923dff11b
big bunch of copyright / docstring update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
1 |
""" |
606923dff11b
big bunch of copyright / docstring update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
2 |
|
606923dff11b
big bunch of copyright / docstring update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3 |
:organization: Logilab |
4212
ab6573088b4a
update copyright: welcome 2010
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1977
diff
changeset
|
4 |
:copyright: 2001-2010 LOGILAB S.A. (Paris, FRANCE), license is LGPL v2. |
1977
606923dff11b
big bunch of copyright / docstring update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
5 |
:contact: http://www.logilab.fr/ -- mailto:contact@logilab.fr |
606923dff11b
big bunch of copyright / docstring update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
6 |
:license: GNU Lesser General Public License, v2.1 - http://www.gnu.org/licenses |
606923dff11b
big bunch of copyright / docstring update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
7 |
""" |
0 | 8 |
from cubicweb.server.hooksmanager import SystemHook |
9 |
||
10 |
CALLED_EVENTS = {} |
|
11 |
||
12 |
class StartupHook(SystemHook): |
|
13 |
events = ('server_startup',) |
|
14 |
def call(self, repo): |
|
15 |
CALLED_EVENTS['server_startup'] = True |
|
16 |
||
17 |
class ShutdownHook(SystemHook): |
|
18 |
events = ('server_shutdown',) |
|
19 |
def call(self, repo): |
|
20 |
CALLED_EVENTS['server_shutdown'] = True |
|
21 |
||
22 |
||
23 |
class LoginHook(SystemHook): |
|
24 |
events = ('session_open',) |
|
25 |
def call(self, session): |
|
26 |
CALLED_EVENTS['session_open'] = session.user.login |
|
27 |
||
28 |
class LogoutHook(SystemHook): |
|
29 |
events = ('session_close',) |
|
30 |
def call(self, session): |
|
31 |
CALLED_EVENTS['session_close'] = session.user.login |