4 CherryPy application, which enables dynamic SQLite3 database file with release
5 comparison information browsing. Database file can be generated with
6 ``ValidationMatrix_v2.py`` script.
8 Author: Albertas Gimbutas, Vilnius University (LT)
9 e-mail: albertasgim@gmail.com
11 import cherrypy
as cpy
13 from os.path
import isfile
14 from jinja2
import Environment, FileSystemLoader, escape
15 from app_utils
import *
17 env = Environment(loader=FileSystemLoader(
'templates'))
22 CherryPy application for release comparison browsing from SQLite3 database files.
23 The SQLite3 database files have to placed in the same directory as this script.
26 def default(self, db_name=None, release_title=None, st_test=None, file_id=None, *args, **kwargs):
27 """CherryPy controller, which handles all Http requests."""
29 threshold = float(kwargs[
'threshold'])
33 context = {
'db_name':db_name,
'release_title':release_title,
34 'threshold': threshold,
'st_test':st_test,
35 'file_id':file_id,
'args':args,
'kwargs':kwargs}
39 db_list_temp = env.get_template(
'db_list.html')
42 return db_list_temp.render(context)
44 if not isfile(db_name +
'.db'):
46 context[
'error'] =
'Does not exist: %s.db' % db_name
47 return db_list_temp.render(context)
49 conn = sqlite3.connect(db_name +
'.db')
51 if not release_title
or not st_test:
52 rel_list_temp = env.get_template(
'release_list.html')
54 return rel_list_temp.render(context)
57 rel_summary_temp = env.get_template(
'release_summary.html')
60 return rel_summary_temp.render(context)
62 dir_summary_temp = env.get_template(
'directory_summary.html')
64 return dir_summary_temp.render(context)
67 if __name__ ==
'__main__':
def get_release_summary_stats
def db_list_with_releases
def get_directory_summary_stats