# Path: lizard_ui/settingshelper.py
# def setup_logging(buildout_dir,
#                   console_level='DEBUG',
#                   file_level='WARN',
#                   sentry_level=None,
#                   sql=False):
#     """Return configuration dict for logging.
# 
#     Some keyword arguments can be used to configure the logging.
# 
#     - ``console_level='DEBUG'`` sets the console level. None means quiet.
# 
#     - ``file_level='WARN'`` sets the var/log/django.log level. None means
#       quiet.
# 
#     - ``sentry_level=None`` sets the sentry level. None means sentry logging
#         is removed from the logging.
# 
#     - ``sql=False`` switches sql statement logging on or off.
# 
#     """
#     result = {
#         'version': 1,
#         'disable_existing_loggers': True,
#         'formatters': {
#             'verbose': {
#                 'format': '%(asctime)s %(name)s %(levelname)s\n%(message)s',
#                 },
#             'simple': {
#                 'format': '%(levelname)s %(message)s'
#                 },
#             },
#         'handlers': {
#             'null': {
#                 'level': 'DEBUG',
#                 'class': 'django.utils.log.NullHandler',
#                 },
#             'console': {
#                 'level': console_level,
#                 'class': 'logging.StreamHandler',
#                 'formatter': 'simple'
#                 },
#             'logfile': {
#                 'level': file_level,
#                 'class': 'logging.FileHandler',
#                 'formatter': 'verbose',
#                 'filename': os.path.join(buildout_dir,
#                                          'var', 'log', 'django.log'),
#                 },
#             'sentry': {
#                 'level': sentry_level,
#                 'class': 'raven.contrib.django.handlers.SentryHandler',
#                 },
#             },
#         'loggers': {
#             '': {
#                 'handlers': [],
#                 'propagate': True,
#                 'level': 'DEBUG',
#                 },
#             'django.db.backends': {
#                 'handlers': ['null'],  # Quiet by default!
#                 'propagate': False,
#                 'level': 'DEBUG',
#                 },
#             },
#         }
#     if console_level is not None:
#         result['loggers']['']['handlers'].append('console')
#     if file_level is not None:
#         result['loggers']['']['handlers'].append('logfile')
#     if sentry_level is not None:
#         result['loggers']['']['handlers'].append('sentry')
#     else:
#         # When sentry is still in the handlers sentry needs to be installed
#         # which gave import errors in Django 1.4.
#         del result['handlers']['sentry']
#     if sql:
#         result['loggers']['django.db.backends']['handlers'] = [
#             'console', 'logfile']
#     return result
# 
# Path: lizard_ui/settingshelper.py
# STATICFILES_FINDERS = (
#     'django.contrib.staticfiles.finders.FileSystemFinder',
#     'django.contrib.staticfiles.finders.AppDirectoriesFinder',
#     # Enable support for django-compressor.
#     'compressor.finders.CompressorFinder',
#     )


import os
from lizard_ui.settingshelper import setup_logging
from lizard_ui.settingshelper import STATICFILES_FINDERS
SETTINGS_DIR = os.path.dirname(os.path.realpath(__file__))

# BUILDOUT_DIR is for access to the "surrounding" buildout,
# for instance for BUILDOUT_DIR/var/static files to give
# django-staticfiles a proper place to place all collected
# static files.
BUILDOUT_DIR = os.path.abspath(os.path.join(SETTINGS_DIR, '..'))

# Absolute path to the directory that holds user-uploaded
# media.
MEDIA_ROOT = os.path.join(BUILDOUT_DIR, 'var', 'media')
# Absolute path to the directory where django-staticfiles'
# "bin/django build_static" places all collected static
# files from all applications' /media directory.
STATIC_ROOT = os.path.join(BUILDOUT_DIR, 'var', 'static')

# URL that handles the media served from MEDIA_ROOT. Make
# sure to use a trailing slash if there is a path component
# (optional in other cases).
MEDIA_URL = '/media/'
# URL for the per-application /media static files collected
# by django-staticfiles.  Use it in templates like "{{
# MEDIA_URL }}mypackage/my.css".
STATIC_URL = '/static_media/'
# URL prefix for admin media -- CSS, JavaScript and
# images. Make sure to use a trailing slash.  Uses
# STATIC_URL as django-staticfiles nicely collects admin's
# static media into STATIC_ROOT/admin.
ADMIN_MEDIA_PREFIX = STATIC_URL + 'admin/'


# Path: lizard_ui/settingshelper.py
# def setup_logging(buildout_dir,
#                   console_level='DEBUG',
#                   file_level='WARN',
#                   sentry_level=None,
#                   sql=False):
#     """Return configuration dict for logging.
# 
#     Some keyword arguments can be used to configure the logging.
# 
#     - ``console_level='DEBUG'`` sets the console level. None means quiet.
# 
#     - ``file_level='WARN'`` sets the var/log/django.log level. None means
#       quiet.
# 
#     - ``sentry_level=None`` sets the sentry level. None means sentry logging
#         is removed from the logging.
# 
#     - ``sql=False`` switches sql statement logging on or off.
# 
#     """
#     result = {
#         'version': 1,
#         'disable_existing_loggers': True,
#         'formatters': {
#             'verbose': {
#                 'format': '%(asctime)s %(name)s %(levelname)s\n%(message)s',
#                 },
#             'simple': {
#                 'format': '%(levelname)s %(message)s'
#                 },
#             },
#         'handlers': {
#             'null': {
#                 'level': 'DEBUG',
#                 'class': 'django.utils.log.NullHandler',
#                 },
#             'console': {
#                 'level': console_level,
#                 'class': 'logging.StreamHandler',
#                 'formatter': 'simple'
#                 },
#             'logfile': {
#                 'level': file_level,
#                 'class': 'logging.FileHandler',
#                 'formatter': 'verbose',
#                 'filename': os.path.join(buildout_dir,
#                                          'var', 'log', 'django.log'),
#                 },
#             'sentry': {
#                 'level': sentry_level,
#                 'class': 'raven.contrib.django.handlers.SentryHandler',
#                 },
#             },
#         'loggers': {
#             '': {
#                 'handlers': [],
#                 'propagate': True,
#                 'level': 'DEBUG',
#                 },
#             'django.db.backends': {
#                 'handlers': ['null'],  # Quiet by default!
#                 'propagate': False,
#                 'level': 'DEBUG',
#                 },
#             },
#         }
#     if console_level is not None:
#         result['loggers']['']['handlers'].append('console')
#     if file_level is not None:
#         result['loggers']['']['handlers'].append('logfile')
#     if sentry_level is not None:
#         result['loggers']['']['handlers'].append('sentry')
#     else:
#         # When sentry is still in the handlers sentry needs to be installed
#         # which gave import errors in Django 1.4.
#         del result['handlers']['sentry']
#     if sql:
#         result['loggers']['django.db.backends']['handlers'] = [
#             'console', 'logfile']
#     return result
# 
# Path: lizard_ui/settingshelper.py
# STATICFILES_FINDERS = (
#     'django.contrib.staticfiles.finders.FileSystemFinder',
#     'django.contrib.staticfiles.finders.AppDirectoriesFinder',
#     # Enable support for django-compressor.
#     'compressor.finders.CompressorFinder',
#     )


# Path: lizard_ui/testsettings.py
import os
from lizard_ui.settingshelper import setup_logging
from lizard_ui.settingshelper import STATICFILES_FINDERS

SETTINGS_DIR = os.path.dirname(os.path.realpath(__file__))

# BUILDOUT_DIR is for access to the "surrounding" buildout,
# for instance for BUILDOUT_DIR/var/static files to give
# django-staticfiles a proper place to place all collected
# static files.
BUILDOUT_DIR = os.path.abspath(os.path.join(SETTINGS_DIR, '..'))

# Absolute path to the directory that holds user-uploaded
# media.
MEDIA_ROOT = os.path.join(BUILDOUT_DIR, 'var', 'media')
# Absolute path to the directory where django-staticfiles'
# "bin/django build_static" places all collected static
# files from all applications' /media directory.
STATIC_ROOT = os.path.join(BUILDOUT_DIR, 'var', 'static')

# URL that handles the media served from MEDIA_ROOT. Make
# sure to use a trailing slash if there is a path component
# (optional in other cases).
MEDIA_URL = '/media/'
# URL for the per-application /media static files collected
# by django-staticfiles.  Use it in templates like "{{
# MEDIA_URL }}mypackage/my.css".
STATIC_URL = '/static_media/'
# URL prefix for admin media -- CSS, JavaScript and
# images. Make sure to use a trailing slash.  Uses
# STATIC_URL as django-staticfiles nicely collects admin's
# static media into STATIC_ROOT/admin.
ADMIN_MEDIA_PREFIX = STATIC_URL + 'admin/'


STATICFILES_FINDERS = STATICFILES_FINDERS