<commit_before>"""
Convenience module for access of application-specific settings, which
enforces default settings when the main settings module does not contain
the appropriate settings.
"""
from django.conf import settings

try:
    STANDALONE = settings.FORUM_STANDALONE
except AttributeError:
    STANDALONE = False

try:
    DEFAULT_POSTS_PER_PAGE = settings.FORUM_DEFAULT_POSTS_PER_PAGE
except AttributeError:
    DEFAULT_POSTS_PER_PAGE = 20

try:
    DEFAULT_TOPICS_PER_PAGE = settings.FORUM_DEFAULT_TOPICS_PER_PAGE
except AttributeError:
    DEFAULT_TOPICS_PER_PAGE = 30

try:
    POST_FORMATTING_MODULE = settings.FORUM_POST_FORMATTING_MODULE
except AttributeError:
    POST_FORMATTING_MODULE = 'forum.formatters.basic_formatter'

try:
    MAX_AVATAR_FILESIZE = settings.FORUM_MAX_AVATAR_FILESIZE
except AttributeError:
    MAX_AVATAR_FILESIZE = 512 * 1024 # 512 kB

try:
    ALLOWED_AVATAR_FORMATS = settings.FORUM_ALLOWED_AVATAR_FORMATS
except AttributeError:
    ALLOWED_AVATAR_FORMATS = ('GIF', 'JPEG', 'PNG')

try:
    MAX_AVATAR_DIMENSIONS = settings.FORUM_MAX_AVATAR_DIMENSIONS
except AttributeError:
    MAX_AVATAR_DIMENSIONS = (64, 64)

try:
    FORCE_AVATAR_DIMENSIONS = settings.FORUM_FORCE_AVATAR_DIMENSIONS
except AttributeError:
    FORCE_AVATAR_DIMENSIONS = True<commit_msg>App settings are now expressed much more succinctly - thanks to Sandra24 and dougn in #django<commit_after>"""
Convenience module for access of application-specific settings, which
enforces default settings when the main settings module does not contain
the appropriate settings.
"""
from django.conf import settings

STANDALONE              = getattr(settings, 'FORUM_STANDALONE',              False)
DEFAULT_POSTS_PER_PAGE  = getattr(settings, 'FORUM_DEFAULT_POSTS_PER_PAGE',  20)
DEFAULT_TOPICS_PER_PAGE = getattr(settings, 'FORUM_DEFAULT_TOPICS_PER_PAGE', 30)
POST_FORMATTING_MODULE  = getattr(settings, 'FORUM_POST_FORMATTING_MODULE',  'forum.formatters.basic_formatter')
MAX_AVATAR_FILESIZE     = getattr(settings, 'FORUM_MAX_AVATAR_FILESIZE',     512 * 1024)
ALLOWED_AVATAR_FORMATS  = getattr(settings, 'FORUM_ALLOWED_AVATAR_FORMATS',  ('GIF', 'JPEG', 'PNG'))
MAX_AVATAR_DIMENSIONS   = getattr(settings, 'FORUM_MAX_AVATAR_DIMENSIONS',   (64, 64))
FORCE_AVATAR_DIMENSIONS = getattr(settings, 'FORUM_FORCE_AVATAR_DIMENSIONS', True)
{'fraction_non_alphanumeric': 0.0689802913453299, 'fraction_numerical': 0.014995715509854327, 'mean_word_length': 6.054380664652568, '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': '3461945', 'n_tokens_mistral': 841, 'n_tokens_neox': 787, 'n_words': 165}