<commit_before>from django.conf import settings

triggers_module_name = ['denorm.db', settings.DATABASE_ENGINE,'triggers']
try:
    triggers = __import__('.'.join(triggers_module_name),{},{},[''])
except ImportError:
    raise ImportError("There is no django-denorm database module for the engine '%s'. Please either choose a supported one, or remove 'denorm' from INSTALLED_APPS.\n" % settings.DATABASE_ENGINE)

<commit_msg>Added initial fix for Django 1.2 DATABASE dicts (only uses defualt for just now)<commit_after>from django.conf import settings

if hasattr(settings, 'DATABASE_ENGINE') and settings.DATABASE_ENGINE:
    print "ENGINE US %s" % settings.DATABASE_ENGINE
    backend = settings.DATABASE_ENGINE
else:
    # Assume Django 1.2
    from django.db import connections, DEFAULT_DB_ALIAS
    engine = connections[DEFAULT_DB_ALIAS].settings_dict['ENGINE']
    backend = engine.rsplit(".", 1)[1]
    print backend

triggers_module_name = ['denorm.db', backend, 'triggers']
try:
    triggers = __import__('.'.join(triggers_module_name),{},{},[''])
except ImportError:
    raise ImportError("There is no django-denorm database module for the engine '%s'. Please either choose a supported one, or remove 'denorm' from INSTALLED_APPS.\n" % backend)


{'fraction_non_alphanumeric': 0.11464968152866242, 'fraction_numerical': 0.004777070063694267, 'mean_word_length': 5.285, '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': '5274518', 'n_tokens_mistral': 407, 'n_tokens_neox': 392, 'n_words': 112}