<commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-

import os

import tornado.ioloop
import tornado.web
import tornado.httpserver

from handler import *

class App(tornado.web.Application):
    def __init__(self):
        handlers = [
            (r'/', IndexHandler),
            (r'/c[/]?', MainHandler),
            (r'/c/(.*)', SingleHandler),
        ]

        settings = {
            'template_path': os.path.join(os.path.dirname(__file__), "templates"),
            "static_path": os.path.join(os.path.dirname(__file__), "static"),
        }

        tornado.web.Application.__init__(self, handlers, **settings)
<commit_msg>Fix issue #3 Try to init database when app is running<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-

import os

import tornado.ioloop
import tornado.web
import tornado.httpserver

import model
from handler import *

class App(tornado.web.Application):
    def __init__(self):
        #Init databas
        model.init()

        handlers = [
            (r'/', IndexHandler),
            (r'/c[/]?', MainHandler),
            (r'/c/(.*)', SingleHandler),
        ]

        settings = {
            'template_path': os.path.join(os.path.dirname(__file__), "templates"),
            "static_path": os.path.join(os.path.dirname(__file__), "static"),
        }

        tornado.web.Application.__init__(self, handlers, **settings)

{'fraction_non_alphanumeric': 0.1540130151843818, 'fraction_numerical': 0.0021691973969631237, 'mean_word_length': 2.4088669950738915, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5347742', 'n_tokens_mistral': 443, 'n_tokens_neox': 421, 'n_words': 87}