From: Christoph Egger Date: Fri, 28 Nov 2014 23:39:49 +0000 (+0100) Subject: Add keysize to index page X-Git-Url: https://git.siccegge.de//index.cgi?a=commitdiff_plain;h=4d652ea07a4eb050820af872f3cd00d832ddcf9b;p=ksp-webtool.git Add keysize to index page --- diff --git a/server.py b/server.py index e2d2038..c4f35dd 100644 --- a/server.py +++ b/server.py @@ -5,6 +5,7 @@ import pgpdump import glob import base64 import os.path +import math basedir = '.' app = Flask(__name__) @@ -13,6 +14,10 @@ app = Flask(__name__) def base64_filter(arg): return base64.b64encode(arg) +@app.template_filter('log2') +def log2_filter(arg): + return int(math.log(arg, 2) + 1) + @app.route("/pks/add", methods=['POST']) def add(): keytext = request.form['keytext'] diff --git a/templates/index.html b/templates/index.html index 2827c1a..4d3438c 100644 --- a/templates/index.html +++ b/templates/index.html @@ -19,6 +19,7 @@ {% endif %} + {{data[entry][0].modulus|log2}} {{data[entry][0].pub_algorithm_type}} {{data[entry][0].creation_time}} (expires {{data[entry][0].expiration_time}})