From 6ad5d4e6cb7a525fdd4cf395a246e9720e407471 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs?= Date: Tue, 21 Apr 2020 15:53:20 -0500 Subject: [PATCH] pep 8 --- plugins/pelican_comments/pelican_comments.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/plugins/pelican_comments/pelican_comments.py b/plugins/pelican_comments/pelican_comments.py index 80d9ec3..66edcd4 100644 --- a/plugins/pelican_comments/pelican_comments.py +++ b/plugins/pelican_comments/pelican_comments.py @@ -8,7 +8,7 @@ import collections import hashlib # libravatar import pelican.signals as signals -import pelican.generators as generators +# import pelican.generators as generators import pelican.readers as readers from pelican.contents import Content @@ -87,12 +87,13 @@ class CommentReader(object): (comment_filename, )) self._comments[comment.metadata['post_id']].append(comment) - # Libravatar + # LibreAvatar + librevatar_url = 'https://cdn.libravatar.org/avatar' # Check the presence of the Email header if 'email' in comment.metadata: email = comment.metadata['email'].encode('utf-8') ehash = hashlib.md5(email.strip().lower()).hexdigest() - comment.avatar = "https://cdn.libravatar.org/avatar/%s" % (ehash) + comment.avatar = "%s/%s" % (librevatar_url, ehash) else: raise Exception("comment %s does not have a email" % (comment_filename))