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

"""
all configuration options and dicts of external
information (dormitory mapping etc.)
Project-specific options should be included in the `config_local.py`,
which is a file not tracked in git containing IPs, user names, passwords, etc.
"""

from flask.ext.babel import gettext

SECRET_KEY = ""

LOG_FILE = '/tmp/error.log'

FLATPAGES_ROOT = ""
FLATPAGES_EXTENSION = '.md'
FLATPAGES_MARKDOWN_EXTENSIONS = [
    'sane_lists',
    'sipa.utils.bootstraped_tables',
    'nl2br',
    'meta',
    'attr_list'
]

LOGGING_CONFIG_LOCATION = "sipa/default_log_config"

# Mail configuration
MAILSERVER_HOST = "127.0.0.1"
MAILSERVER_PORT = 25

# LDAP configuration
LDAP_HOST = "127.0.0.1"
LDAP_PORT = 389
LDAP_SEARCH_BASE = ""

# MySQL configuration
DB_ATLANTIS_HOST = "127.0.0.1"
DB_ATLANTIS_USER = ""
DB_ATLANTIS_PASSWORD = ""

# MySQL Helios configuration
DB_HELIOS_HOST = "127.0.0.1"
DB_HELIOS_PORT = 3307   # alternative port for 2nd db
DB_HELIOS_USER = ""
DB_HELIOS_PASSWORD = ""

SQL_TIMEOUT = 15

# todo further modularization. id mappings are rather specific than generous.
# MySQL id mappings
DORMITORIES = [
    u'Wundstraße 5',
    u'Wundstraße 7',
    u'Wundstraße 9',
    u'Wundstraße 11',
    u'Wundstraße 1',
    u'Wundstraße 3',
    u'Zellescher Weg 41',
    u'Zellescher Weg 41A',
    u'Zellescher Weg 41B',
    u'Zellescher Weg 41C',
    u'Zellescher Weg 41D'
]

STATUS = {
    # todo vervollständigen oder mindestens fehlerresistent machen!
    # (Hat ein Nutzer einen unten nicht enthaltenen Status, gibts einen Fehler)
    1: gettext(u'Bezahlt, verbunden'),
    2: gettext(u'Nicht bezahlt, Netzanschluss gesperrt'),
    7: gettext(u'Verstoß gegen Netzordnung, Netzanschluss gesperrt'),
    9: gettext(u'Exaktiv'),
    12: gettext(u'Trafficlimit überschritten, Netzanschluss gesperrt')<commit_msg>Added the feature configuring sipa with Environmentalvaribales<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-

"""
all configuration options and dicts of external
information (dormitory mapping etc.)
Project-specific options should be included in the `config_local.py`,
which is a file not tracked in git containing IPs, user names, passwords, etc.
"""

import os
from flask.ext.babel import gettext

SECRET_KEY = os.getenv("SIPA_SECRET_KEY", "insecuresecretKey")

LOG_FILE = '/tmp/error.log'

FLATPAGES_ROOT = os.getenv("SIPA_FLATPAGES_ROOT", "../content")
FLATPAGES_EXTENSION =  os.getenv("SIPA_FLATPAGES_EXTENSION", '.md')
sipa_flatpages_markdown_extensions = os.getenv("SIPA_FLATPAGES_MARKDOWN_EXTENSIONS")
if sipa_flatpages_markdown_extensions is not None:
    sipa_flatpages_markdown_extensions = sipa_flatpages_markdown_extensions.split(',')
else:
    sipa_flatpages_markdown_extensions = [
        'sane_lists',
        'sipa.utils.bootstraped_tables',
        'nl2br',
        'meta',
        'attr_list'
    ]
FLATPAGES_MARKDOWN_EXTENSIONS = sipa_flatpages_markdown_extensions

LOGGING_CONFIG_LOCATION = os.getenv("SIPA_LOGGING_CONFIG_LOCATION", "sipa/default_log_config")

# Mail configuration
MAILSERVER_HOST = os.getenv("SIPA_MAILSERVER_HOST", "127.0.0.1")
MAILSERVER_PORT = int(os.getenv("SIPA_MAILSERVER_PORT", '25'))

# LDAP configuration
LDAP_HOST = os.getenv("SIPA_LDAP_HOST", "127.0.0.1")
LDAP_PORT = int(os.getenv("SIPA_LDAP_PORT", '389'))
LDAP_SEARCH_BASE = os.getenv("SIPA_LDAP_SEARCH_BASE", "")

# MySQL configuration
DB_ATLANTIS_HOST = os.getenv("SIPA_DB_ATLANTIS_HOST", "127.0.0.1")
DB_ATLANTIS_USER = os.getenv("SIPA_DB_ATLANTIS_USER", "")
DB_ATLANTIS_PASSWORD = os.getenv("SIPA_DB_ATLANTIS_PASSWORD", "")

# MySQL Helios configuration
DB_HELIOS_HOST = os.getenv("SIPA_DB_HELIOS_HOST", "127.0.0.1")
DB_HELIOS_PORT = int(os.getenv("SIPA_DB_HELIOS_PORT", '3307'))  # alternative port for 2nd db
DB_HELIOS_USER = os.getenv("SIPA_DB_HELIOS_USER", "")
DB_HELIOS_PASSWORD = os.getenv("SIPA_DB_HELIOS_PASSWORD", "")

SQL_TIMEOUT = int(os.getenv("SIPA_SQL_TIMEOUT", '15'))

# todo further modularization. id mappings are rather specific than generous.
# MySQL id mappings
DORMITORIES = [
    u'Wundstraße 5',
    u'Wundstraße 7',
    u'Wundstraße 9',
    u'Wundstraße 11',
    u'Wundstraße 1',
    u'Wundstraße 3',
    u'Zellescher Weg 41',
    u'Zellescher Weg 41A',
    u'Zellescher Weg 41B',
    u'Zellescher Weg 41C',
    u'Zellescher Weg 41D'
]

STATUS = {
    # todo vervollständigen oder mindestens fehlerresistent machen!
    # (Hat ein Nutzer einen unten nicht enthaltenen Status, gibts einen Fehler)
    1: gettext(u'Bezahlt, verbunden'),
    2: gettext(u'Nicht bezahlt, Netzanschluss gesperrt'),
    7: gettext(u'Verstoß gegen Netzordnung, Netzanschluss gesperrt'),
    9: gettext(u'Exaktiv'),
    12: gettext(u'Trafficlimit überschritten, Netzanschluss gesperrt')
{'fraction_non_alphanumeric': 0.11416003351487222, 'fraction_numerical': 0.025555090071219103, 'mean_word_length': 4.887792848335389, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 8, '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': '3790815', 'n_tokens_mistral': 1946, 'n_tokens_neox': 1844, 'n_words': 378}