author | Sylvain Thénault <sylvain.thenault@logilab.fr> |
Wed, 16 Sep 2009 19:25:01 +0200 | |
branch | 3.5 |
changeset 3271 | 6c8504b2ade0 |
parent 1977 | 606923dff11b |
child 3397 | a35c6ae5bef2 |
child 4212 | ab6573088b4a |
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 |
606923dff11b
big bunch of copyright / docstring update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
4 |
:copyright: 2001-2009 LOGILAB S.A. (Paris, FRANCE), license is LGPL v2. |
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 |