changeset 19:56cab60172ad

Fix issue in text import, Improve display of running versions
author Benoît Allard <benoit.allard@greenbone.net>
date Wed, 01 Oct 2014 09:29:38 +0200
parents d547b6a0038e
children 94bc7fe98b85
files farol/main.py farol/templates/about.j2
diffstat 2 files changed, 11 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/farol/main.py	Tue Sep 30 16:27:42 2014 +0200
+++ b/farol/main.py	Wed Oct 01 09:29:38 2014 +0200
@@ -25,6 +25,7 @@
 import os
 import logging
 from logging import FileHandler
+import platform
 import urllib2
 from xml.etree import ElementTree as ET
 
@@ -129,9 +130,9 @@
     set_url("http://tools.cisco.com/security/center/contentxml/CiscoSecurity%(kind)s/cisco-%(id)s/cvrf/cisco-%(id)s_cvrf.xml" % {'kind': kind, 'id': id_})
 
 def set_text(text):
-    try: doc = parse(content)
+    try: doc = parse(text)
     except ET.ParseError as e:
-        flash('Unable to parse %s: %s' % (url, e))
+        flash('Unable to parse Document: %s' % e)
         return
     set_current(doc)
 
@@ -177,6 +178,8 @@
 
 @app.route('/about')
 def about():
-    versions = (('farol', __version__), ('farolluz', farolluz.__version__), ('flask', flask.__version__))
+    versions = ((platform.python_implementation(), platform.python_version()),
+                ('Farol', __version__), ('FarolLuz', farolluz.__version__),
+                ('Flask', flask.__version__))
     return render_template('about.j2', instance_dir=app.instance_path, versions=versions)
 
--- a/farol/templates/about.j2	Tue Sep 30 16:27:42 2014 +0200
+++ b/farol/templates/about.j2	Wed Oct 01 09:29:38 2014 +0200
@@ -54,13 +54,12 @@
     <p>Each session have a <strong>private cache</strong>, sessions are bound to a browser <em>session</em>. They are usually reset when the browser is restarted.</p>
   {% endif %}
   <hr>
-  <h5>Versions:</h5>
-  <ul class="list-inline">
+  <p><strong>Farol</strong> is published under GPLv2+, and is Copyright &copy; Greenbone Networks GmbH.</p>
+  <span class="text-muted pull-right"><small>SessionID: {{ session.get('id', '') }}</small></span>
+  <p class="text-muted"><small>Now running:
   {% for product, version in versions %}
-    <li>{{ product }}: <tt><small>{{ version }}</small></tt></li>
+    {{ product }}: <tt>{{ version }}</tt>{{ ' / '  if not loop.last }}
   {% endfor %}
-  </ul>
-  <p><strong>Farol</strong> is published under GPLv2+, and is Copyright &copy; Greenbone Networks GmbH.</p>
-  <p class="text-muted text-right"><small>SessionID: {{ session.get('id', '') }}</small></p>
+</small></p>
 </div>
 {% endblock %}

http://farol.wald.intevation.org