--- a/web/views/euser.py Fri Feb 06 11:05:41 2009 +0100
+++ b/web/views/euser.py Fri Feb 06 12:03:58 2009 +0100
@@ -14,14 +14,11 @@
from cubicweb.web.form import EntityForm
from cubicweb.web.views.baseviews import PrimaryView, EntityView
-import hashlib
+try:
+ from hashlib import sha1 as sha
-try:
- from hashlib import sha1
-
except ImportError:
- from sha import sha as sha1
-
+ from sha import sha
class EUserPrimaryView(PrimaryView):
accepts = ('EUser',)
@@ -75,7 +72,7 @@
% html_escape(entity.firstname))
emailaddr = entity.get_email()
if emailaddr:
- m = hashlib.sha1()
+ m = sha()
m.update(html_escape(emailaddr))
crypt_sha1 = m.hexdigest()
self.w(u'<foaf:mbox_sha1sum>%s</foaf:mbox_sha1sum>\n' % crypt_sha1)