<commit_before>#!/usr/bin/python

from flup.server.fcgi import WSGIServer
import rhizi_api
import os
import db_controller as dbc
from rhizi_server import Config

if __name__ == '__main__':
    cfg_dir = '/etc/rhizi'
    cfg = Config.init_from_file(os.path.join(cfg_dir, 'rhizi-server.conf'))

    db_ctl = dbc.DB_Controller(cfg)
    rhizi_api.db_ctl = db_ctl
    WSGIServer(rhizi_api.webapp).run()<commit_msg>rhizi .fcgi script - renamed on deployment<commit_after>#!/usr/bin/python

from flup.server.fcgi import WSGIServer
import os
import sys
import cgitb
import rhizi_server

# sys.path.insert(0, '/srv/www/rhizi/rhizi.net/src-py')

# enable debugging
cgitb.enable()

if __name__ == '__main__':
    cfg_dir = '/etc/rhizi'
    cfg = rhizi_server.Config.init_from_file(os.path.join(cfg_dir, 'rhizi-server.conf'))

    log = rhizi_server.init_logging()
    webapp = rhizi_server.init_webapp(cfg)
    rhizi_server.init_rest_api(webapp)

    log.info('launching webapp via flup.server.fcgi.WSGIServer')

    WSGIServer(webapp).run()
{'fraction_non_alphanumeric': 0.1203883495145631, 'fraction_numerical': 0.000970873786407767, 'mean_word_length': 4.426315789473684, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 1, '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': '2616371', 'n_tokens_mistral': 407, 'n_tokens_neox': 388, 'n_words': 70}