equal
deleted
inserted
replaced
18 """Specific views for users and groups""" |
18 """Specific views for users and groups""" |
19 |
19 |
20 __docformat__ = "restructuredtext en" |
20 __docformat__ = "restructuredtext en" |
21 _ = unicode |
21 _ = unicode |
22 |
22 |
23 import hashlib |
23 from hashlib import sha1 # pylint: disable=E0611 |
24 |
24 |
25 from logilab.mtconverter import xml_escape |
25 from logilab.mtconverter import xml_escape |
26 |
26 |
27 from cubicweb import tags |
27 from cubicweb import tags |
28 from cubicweb.schema import display_name |
28 from cubicweb.schema import display_name |
84 self.w(u'<foaf:givenName>%s</foaf:givenName>\n' |
84 self.w(u'<foaf:givenName>%s</foaf:givenName>\n' |
85 % xml_escape(entity.firstname)) |
85 % xml_escape(entity.firstname)) |
86 emailaddr = entity.cw_adapt_to('IEmailable').get_email() |
86 emailaddr = entity.cw_adapt_to('IEmailable').get_email() |
87 if emailaddr: |
87 if emailaddr: |
88 self.w(u'<foaf:mbox_sha1sum>%s</foaf:mbox_sha1sum>\n' |
88 self.w(u'<foaf:mbox_sha1sum>%s</foaf:mbox_sha1sum>\n' |
89 % hashlib.sha1(emailaddr.encode('utf-8')).hexdigest()) |
89 % sha1(emailaddr.encode('utf-8')).hexdigest()) |
90 self.w(u'</foaf:Person>\n') |
90 self.w(u'</foaf:Person>\n') |
91 |
91 |
92 |
92 |
93 # group views ################################################################## |
93 # group views ################################################################## |
94 |
94 |