]> git.siccegge.de Git - ksp-webtool.git/commitdiff
Add keysize to index page
authorChristoph Egger <christoph@anonymous.siccegge.de>
Fri, 28 Nov 2014 23:39:49 +0000 (00:39 +0100)
committerChristoph Egger <christoph@anonymous.siccegge.de>
Fri, 28 Nov 2014 23:39:49 +0000 (00:39 +0100)
server.py
templates/index.html

index e2d20389af59d998ce8f76f8c10ea63be8df99b2..c4f35dd2c6ec65b348759261b509d81ce36413bc 100644 (file)
--- 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']
index 2827c1aa94fb311e5fca7b3901f879ccef2386c2..4d3438ca4a1d106eaea3a26a22d4769fd4d96197 100644 (file)
@@ -19,6 +19,7 @@
       {% endif %}
     </td>
     <td>
+      {{data[entry][0].modulus|log2}}
       {{data[entry][0].pub_algorithm_type}}
       {{data[entry][0].creation_time}}
       (expires {{data[entry][0].expiration_time}})