From a4a872cf3db60c3005091aac46e386e699232dc3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonatan=20P=C3=A5lsson?= Date: Sun, 4 Jun 2017 19:18:18 +0200 Subject: [PATCH] Calculate colors for all nicks in pubmsgs --- logbot.py | 4 ++++ templates/messages.html | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/logbot.py b/logbot.py index 24afa63..cf0177a 100755 --- a/logbot.py +++ b/logbot.py @@ -67,6 +67,10 @@ pat1 = re.compile(r"(^|[\n ])(([\w]+?://[\w\#$%&~.\-;:=,?@\[\]+]*)(/[\w\#$%&~/.\ flaskapp = Flask(__name__) flaskapp.config["TEMPLATES_AUTO_RELOAD"] = True +@flaskapp.template_filter('md5') +def format_md5(value): + return md5(value).hexdigest() + def urlify2(value): return pat1.sub(r'\1\3', value) #return urlfinder.sub(r'\1', value) diff --git a/templates/messages.html b/templates/messages.html index 7786593..2abe04c 100644 --- a/templates/messages.html +++ b/templates/messages.html @@ -29,7 +29,7 @@ < - + {{ message.nickname }}