def gravatar(email): gravatar_id = md5(email).hexdigest() gravatar_size = options('gravatar_size') #possible values for default are: identicon, monsterid, wavatar, uri of an image default = quote(options('default_gravatar'), safe='') uri = "http://www.gravatar.com/avatar.php?gravatar_id=%s&size=%s&default=%s" return uri % (gravatar_id, gravatar_size, default)
def get_reqid(link): base_url = rm_www(options('base_url')) return link.replace(base_url, '', 1).strip('/')