<commit_before>#!/usr/bin/env python3

import os
import logging

from sqlalchemy import create_engine

from portingdb import load
from portingdb import htmlreport

level = logging.DEBUG
logging.basicConfig(level=level)
logging.getLogger('sqlalchemy.engine').setLevel(level)

sqlite_path = os.path.join(os.environ['OPENSHIFT_TMP_DIR'], 'portingdb.sqlite')

db_url = 'sqlite:///' + sqlite_path

application = htmlreport.create_app(db_url=db_url)

import pprint
pprint.pprint(os.environ)

# For testing only
if __name__ == '__main__':
    from wsgiref.simple_server import make_server
    httpd = make_server('localhost', 8051, application)
    # Wait for a single request, serve it and quit.
    httpd.handle_request()
<commit_msg>Reduce log level on OpenShift<commit_after>#!/usr/bin/env python3

import os
import logging

from sqlalchemy import create_engine

from portingdb import load
from portingdb import htmlreport

level = logging.INFO
logging.basicConfig(level=level)
logging.getLogger('sqlalchemy.engine').setLevel(level)

sqlite_path = os.path.join(os.environ['OPENSHIFT_TMP_DIR'], 'portingdb.sqlite')

db_url = 'sqlite:///' + sqlite_path

application = htmlreport.create_app(db_url=db_url)

import pprint
pprint.pprint(os.environ)

# For testing only
if __name__ == '__main__':
    from wsgiref.simple_server import make_server
    httpd = make_server('localhost', 8051, application)
    # Wait for a single request, serve it and quit.
    httpd.handle_request()

{'fraction_non_alphanumeric': 0.10047522063815342, 'fraction_numerical': 0.006788866259334691, 'mean_word_length': 5.436681222707423, 'pattern_counts': {'":': 0, '<': 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': '688423', 'n_tokens_mistral': 501, 'n_tokens_neox': 492, 'n_words': 118}