<commit_before>import os

from app import create_app, db

# configuration file path
etc_config_path = '/etc/zipnish/ui.cfg'
config_path = os.path.dirname(os.path.abspath(__file__)) + '/ui.cfg'

if os.path.exists(etc_config_path):
	config_path = etc_config_path

app = create_app(config_path)

if __name__ == '__main__':
    app.run(host=app.config['HOST'], 
    		port=app.config['PORT'], 
    		debug=app.config['DEBUG'])<commit_msg>Flask app will use the same .cfg as logreader does.<commit_after>import ConfigParser

from app import create_app


def main():
    etc_config_path = '/etc/zipnish/zipnish.cfg'
    config = ConfigParser.ConfigParser()
    config.read(etc_config_path)

    host = config.get('Database', 'host')
    db = config.get('Database', 'db_name')
    user = config.get('Database', 'user')
    passwd = config.get('Database', 'pass')
    db_port = 3306

    db_dialect = "mysql+mysqldb://{}:{}@{}:{}/{}". \
        format(user, passwd, host, db_port, db)

    app = create_app(db_dialect)
    app.run()

if __name__ == '__main__':
    main()
{'fraction_non_alphanumeric': 0.15428033866415805, 'fraction_numerical': 0.0037629350893697085, 'mean_word_length': 3.9488372093023254, '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': '2797764', 'n_tokens_mistral': 391, 'n_tokens_neox': 379, 'n_words': 76}