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


"""
:mod:`config` --- Default application settings
==============================================
"""


__docformat__ = "restructuredtext en"


from os import path

from utils import get_current_file_path


ROOT_DIR = path.abspath(path.dirname(get_current_file_path()))
PLUGINS_DIR = path.normpath(path.join(ROOT_DIR, "./plugins"))

# CACHE_DIR = path.normpath(path.join(ROOT_DIR, "./cache"))
# LOGS_DIR = path.normpath(path.join(ROOT_DIR, "./logs"))
HOME_DIR = path.normpath(path.join(path.expanduser("~"), ".gooby"))
CACHE_DIR = path.normpath(path.join(HOME_DIR, "./cache"))
LOGS_DIR = path.normpath(path.join(HOME_DIR, "./logs"))

SLEEP_TIME = 1

LOGGING_CONFIG = {
    "version": 1,
    "disable_existing_loggers": True,
    "formatters": {
        "verbose": {
            "format": "%(asctime)-15s %(levelname)s %(name)s: %(message)s",
        },
        "brief": {
            "format": "%(name)s: %(message)s",
        },
    },
    "handlers": {
        "console": {
            "level": "INFO",
            "class": "logging.StreamHandler",
            "formatter": "brief",
        },
        "file": {
            "level": "INFO",
            "class": "logging.handlers.RotatingFileHandler",
            "formatter": "verbose",
            "filename": path.join(LOGS_DIR, "gooby.log"),
            "maxBytes": 128000,
            "backupCount": 4,
        },
        "file_errors": {
            "level": "WARNING",
            "class": "logging.handlers.RotatingFileHandler",
            "formatter": "verbose",
            "filename": path.join(LOGS_DIR, "errors.log"),
            "maxBytes": 128000,
            "backupCount": 4,
        },
        "file_session": {
            "level": "DEBUG",
            "class": "logging.FileHandler",
            "formatter": "verbose",
            "filename": path.join(LOGS_DIR, "session.log"),
            "mode": "w",
        },
    },
    "loggers": {
        "Gooby": {
            "handlers": ["console", "file", "file_errors", "file_session"],
            "level": "DEBUG",
        },
        "Skype4Py": {
            "handlers": ["console", "file", "file_errors", "file_session"],
            "level": "WARNING",
        },
    },
}

# Plugin cache configuration. Keys are case-sensitive and should match
# corresponding plugin class names. Regular Python dictionary is being used as
# a cache-like storage by default unless it hasn't been set explicitly.
#
# It's also possible to add additional config entries to setup the low-level
# cache system usage, i.e.:
#
# >>> cache = cache.get_cache("derp")
#
# will be looking for "derp" cache config entry firstly.
#
# Note this behaviour is a subject to change in a near future to remotely
# match Django cache system which is far more flexible.
CACHE_CONFIG = {
    "VimeoURLParser": {
        "backend": "cache.SQLiteCache",
        "timeout": 0.0,
        "location": path.join(CACHE_DIR, "vimeo.sqlite"),
    },
    "YouTubeURLParser": {
        "backend": "cache.SQLiteCache",
        "timeout": 0.0,
        "location": path.join(CACHE_DIR, "youtube.sqlite"),
    },
    "URLDiscoverer": {
        "backend": "cache.SQLiteCache",
        "timeout": 128000.0 * 42,  # 42 days.
        "location": path.join(CACHE_DIR, "urls.sqlite"),
    },
    "SteamURLParser": {
        "backend": "cache.SQLiteCache",
        "timeout": 3600.0,
        "location": path.join(CACHE_DIR, "steam.sqlite"),
    },
    "HerpDerper": {
        "backend": "cache.SQLiteCache",
        "timeout": 0.0,
        "location": path.join(CACHE_DIR, "herpderper.sqlite"),
    },
}


try:
    from .config_local import *
except ImportError:
    pass
<commit_msg>Typo fix<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-


"""
:mod:`config` --- Default application settings
==============================================
"""


__docformat__ = "restructuredtext en"


from os import path

from utils import get_current_file_path


ROOT_DIR = path.abspath(path.dirname(get_current_file_path()))
PLUGINS_DIR = path.normpath(path.join(ROOT_DIR, "./plugins"))

# CACHE_DIR = path.normpath(path.join(ROOT_DIR, "./cache"))
# LOGS_DIR = path.normpath(path.join(ROOT_DIR, "./logs"))
HOME_DIR = path.normpath(path.join(path.expanduser("~"), ".gooby"))
CACHE_DIR = path.normpath(path.join(HOME_DIR, "./cache"))
LOGS_DIR = path.normpath(path.join(HOME_DIR, "./logs"))

SLEEP_TIME = 1

LOGGING_CONFIG = {
    "version": 1,
    "disable_existing_loggers": True,
    "formatters": {
        "verbose": {
            "format": "%(asctime)-15s %(levelname)s %(name)s: %(message)s",
        },
        "brief": {
            "format": "%(name)s: %(message)s",
        },
    },
    "handlers": {
        "console": {
            "level": "INFO",
            "class": "logging.StreamHandler",
            "formatter": "brief",
        },
        "file": {
            "level": "INFO",
            "class": "logging.handlers.RotatingFileHandler",
            "formatter": "verbose",
            "filename": path.join(LOGS_DIR, "gooby.log"),
            "maxBytes": 128000,
            "backupCount": 4,
        },
        "file_errors": {
            "level": "WARNING",
            "class": "logging.handlers.RotatingFileHandler",
            "formatter": "verbose",
            "filename": path.join(LOGS_DIR, "errors.log"),
            "maxBytes": 128000,
            "backupCount": 4,
        },
        "file_session": {
            "level": "DEBUG",
            "class": "logging.FileHandler",
            "formatter": "verbose",
            "filename": path.join(LOGS_DIR, "session.log"),
            "mode": "w",
        },
    },
    "loggers": {
        "Gooby": {
            "handlers": ["console", "file", "file_errors", "file_session"],
            "level": "DEBUG",
        },
        "Skype4Py": {
            "handlers": ["console", "file", "file_errors", "file_session"],
            "level": "WARNING",
        },
    },
}

# Plugin cache configuration. Keys are case-sensitive and should match
# corresponding plugin class names. Regular Python dictionary is being used as
# a cache-like storage by default unless it hasn't been set explicitly.
#
# It's also possible to add additional config entries to setup the low-level
# cache system usage, i.e.:
#
# >>> cache = cache.get_cache("derp")
#
# will be looking for "derp" cache config entry firstly.
#
# Note this behaviour is a subject to change in a near future to remotely
# match Django cache system which is far more flexible.
CACHE_CONFIG = {
    "VimeoURLParser": {
        "backend": "cache.SQLiteCache",
        "timeout": 0.0,
        "location": path.join(CACHE_DIR, "vimeo.sqlite"),
    },
    "YouTubeURLParser": {
        "backend": "cache.SQLiteCache",
        "timeout": 0.0,
        "location": path.join(CACHE_DIR, "youtube.sqlite"),
    },
    "URLDiscoverer": {
        "backend": "cache.SQLiteCache",
        "timeout": 128000.0 * 42,  # 42 days.
        "location": path.join(CACHE_DIR, "urls.sqlite"),
    },
    "SteamURLParser": {
        "backend": "cache.SQLiteCache",
        "timeout": 3600.0,
        "location": path.join(CACHE_DIR, "steam.sqlite"),
    },
    "HerpDerper": {
        "backend": "cache.SQLiteCache",
        "timeout": 0.0,
        "location": path.join(CACHE_DIR, "herpderper.sqlite"),
    },
}


try:
    from config_local import *
except ImportError:
    pass

{'fraction_non_alphanumeric': 0.1749730603448276, 'fraction_numerical': 0.011314655172413793, 'mean_word_length': 2.477751756440281, 'pattern_counts': {'":': 118, '<': 3, '<?xml version=': 0, '>': 9, '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': '599908', 'n_tokens_mistral': 2414, 'n_tokens_neox': 2317, 'n_words': 509}