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

###  
# Copyright (c) Rice University 2012
# This software is subject to
# the provisions of the GNU Lesser General
# Public License Version 2.1 (LGPL).
# See LICENCE.txt for details.
###

import os
from rhaptos2.user import backend, usermodel
from rhaptos2.user.backend import db_session
from rhaptos2.common import conf
HERE = os.path.abspath(os.path.dirname(__file__))
CONFD_PATH = os.path.join(HERE, "../../local.ini")
confd = conf.get_config(CONFD_PATH)

backend.initdb(confd)

print "Connecting to Database:"
print confd['rhaptos2user']
print "You are now in shell, without access to Flask App, but with dbase"
print "You may want to review prepopulate.py for notes on prepopulating the dbase during development"

<commit_msg>Minor tweak - show which dbase host we are connectinf to<commit_after>#!/usr/bin/env python
#! -*- coding: utf-8 -*-

###  
# Copyright (c) Rice University 2012
# This software is subject to
# the provisions of the GNU Lesser General
# Public License Version 2.1 (LGPL).
# See LICENCE.txt for details.
###

import os
from rhaptos2.user import backend, usermodel
from rhaptos2.user.backend import db_session
from rhaptos2.common import conf
HERE = os.path.abspath(os.path.dirname(__file__))
CONFD_PATH = os.path.join(HERE, "../../local.ini")
confd = conf.get_config(CONFD_PATH)


from rhaptos2.common.configuration import (
    find_configuration_file,
    Configuration,
    )
config = Configuration.from_file(CONFD_PATH)




backend.initdb(config)

print "Connecting to Database:"
print config['pghost']
print "You are now in shell, without access to Flask App, but with dbase"
print "You may want to review prepopulate.py for notes on prepopulating the dbase during development"


{'fraction_non_alphanumeric': 0.10410804727068092, 'fraction_numerical': 0.012380416432189083, 'mean_word_length': 4.521739130434782, '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': '7211671', 'n_tokens_mistral': 575, 'n_tokens_neox': 563, 'n_words': 192}