diff options
| author | toshio <toshio@mm3test.fedoraproject.org> | 2012-03-12 23:27:56 +0000 |
|---|---|---|
| committer | toshio <toshio@mm3test.fedoraproject.org> | 2012-03-12 23:27:56 +0000 |
| commit | 1c4f1cb5a0332a1fcc4d2fa8cf908f029cf23594 (patch) | |
| tree | 53779390ff498842d2b919da62182fe582d4d0ca /lib/__init__.py | |
| download | hyperkitty-1c4f1cb5a0332a1fcc4d2fa8cf908f029cf23594.tar.gz hyperkitty-1c4f1cb5a0332a1fcc4d2fa8cf908f029cf23594.tar.xz hyperkitty-1c4f1cb5a0332a1fcc4d2fa8cf908f029cf23594.zip | |
Import the initial version of the hyperkitty archiver
Diffstat (limited to 'lib/__init__.py')
| -rw-r--r-- | lib/__init__.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/__init__.py b/lib/__init__.py new file mode 100644 index 0000000..aa5a3d9 --- /dev/null +++ b/lib/__init__.py @@ -0,0 +1,14 @@ +#-*- coding: utf-8 -*- + +from hashlib import md5 +import urllib + + +def gravatar_url(email): + '''Return a gravatar url for an email address''' + size = 64 + default = "http://fedoraproject.org/static/images/" + \ + "fedora_infinity_%ix%i.png" % (size, size) + query_string = urllib.urlencode({'s': size, 'd': default}) + identifier = md5(email).hexdigest() + return 'http://www.gravatar.com/avatar/%s?%s' % (identifier, query_string) |
