Beispiel #1
0
 def url_for_email(email, imgsize):
     email_hash = hashlib.md5(core.encode(email)).hexdigest()
     default_url = 'http://git-cola.github.io/images/git-64x64.jpg'
     encoded_url = urllib.quote(default_url, '')
     query = '?s=%d&d=%s' % (imgsize, encoded_url)
     url = 'http://gravatar.com/avatar/' + email_hash + query
     return url
Beispiel #2
0
 def url_for_email(email, imgsize):
     email_hash = hashlib.md5(core.encode(email)).hexdigest()
     default_url = b'http://git-cola.github.io/images/git-64x64.jpg'
     encoded_url = urllib.quote(default_url, b'')
     query = '?s=%d&d=%s' % (imgsize, encoded_url)
     url = 'http://gravatar.com/avatar/' + email_hash + query
     return url
Beispiel #3
0
 def url_for_email(email, imgsize):
     email_hash = hashlib.md5(core.encode(email)).hexdigest()
     default_url = b"https://git-cola.github.io/images/git-64x64.jpg"
     encoded_url = urllib.quote(default_url, b"")
     query = "?s=%d&d=%s" % (imgsize, encoded_url)
     url = "https://gravatar.com/avatar/" + email_hash + query
     return url
Beispiel #4
0
 def url_for_email(email, imgsize):
     email_hash = core.decode(hashlib.md5(core.encode(email)).hexdigest())
     # Python2.6 requires byte strings for urllib.quote() so we have
     # to force
     default_url = 'https://git-cola.github.io/images/git-64x64.jpg'
     encoded_url = urllib.quote(core.encode(default_url), core.encode(''))
     query = '?s=%d&d=%s' % (imgsize, core.decode(encoded_url))
     url = 'https://gravatar.com/avatar/' + email_hash + query
     return url