1 """helper functions for application hooks |
1 """helper functions for application hooks |
2 |
2 |
3 :organization: Logilab |
3 :organization: Logilab |
4 :copyright: 2001-2008 LOGILAB S.A. (Paris, FRANCE), all rights reserved. |
4 :copyright: 2001-2009 LOGILAB S.A. (Paris, FRANCE), all rights reserved. |
5 :contact: http://www.logilab.fr/ -- mailto:contact@logilab.fr |
5 :contact: http://www.logilab.fr/ -- mailto:contact@logilab.fr |
6 """ |
6 """ |
7 __docformat__ = "restructuredtext en" |
7 __docformat__ = "restructuredtext en" |
8 |
8 |
9 from smtplib import SMTP |
9 from smtplib import SMTP |
10 from threading import Lock |
10 from threading import Lock |
11 |
11 |
12 from cubicweb import RepositoryError |
12 from cubicweb import RepositoryError |
13 from cubicweb.server.pool import Operation, SingleLastOperation |
13 from cubicweb.server.pool import SingleLastOperation |
14 |
14 |
15 |
15 |
16 def entity_name(session, eid): |
16 def entity_name(session, eid): |
17 """return the "name" attribute of the entity with the given eid""" |
17 """return the "name" attribute of the entity with the given eid""" |
18 return entity_attr(session, eid, 'name') |
18 return entity_attr(session, eid, 'name') |