# Path: staticgen/conf.py
# class StaticgenConf(AppConf):
#     class Meta:
#     SITEMAP_URL = None
#     FAIL_SILENTLY = True
#     MULTITHREAD = True
#     BUCKET_NAME = getattr(settings, 'AWS_STORAGE_BUCKET_NAME', '')
#     STATIC_SITE_DOMAIN = None
# 
# Path: staticgen/exceptions.py
# class StaticgenError(Exception):
#     pass
# 
# Path: staticgen/helpers.py
# def get_static_site_domain():
#     static_site_domain = settings.STATICGEN_STATIC_SITE_DOMAIN
#     if static_site_domain is None:
#         connection = connect_s3(
#             settings.AWS_ACCESS_KEY_ID,
#             settings.AWS_SECRET_ACCESS_KEY
#         )
#         bucket = connection.get_bucket(settings.AWS_STORAGE_BUCKET_NAME)
#         static_site_domain = bucket.get_website_endpoint()
#     return static_site_domain.rstrip('/')


import logging
from django.core.urlresolvers import resolve, reverse
from django.shortcuts import resolve_url
from django.test import Client
from django.utils import translation
from django.utils.translation import ugettext_lazy as _
from .conf import settings
from .exceptions import StaticgenError
from .helpers import get_static_site_domain
from .status import is_success
# -*- coding: utf-8 -*-

from __future__ import unicode_literals




logger = logging.getLogger('staticgen')


class StaticgenView(object):
    is_paginated = False

    def __init__(self, *args, **kwargs):
        super(StaticgenView, self).__init__(*args, **kwargs)
        self.client = Client(SERVER_NAME=get_static_site_domain())

    def items(self):
        return []

    def log_error(self, message):
        logger.error(message)
        if not settings.STATICGEN_FAIL_SILENTLY:

# Path: staticgen/conf.py
# class StaticgenConf(AppConf):
#     class Meta:
#     SITEMAP_URL = None
#     FAIL_SILENTLY = True
#     MULTITHREAD = True
#     BUCKET_NAME = getattr(settings, 'AWS_STORAGE_BUCKET_NAME', '')
#     STATIC_SITE_DOMAIN = None
# 
# Path: staticgen/exceptions.py
# class StaticgenError(Exception):
#     pass
# 
# Path: staticgen/helpers.py
# def get_static_site_domain():
#     static_site_domain = settings.STATICGEN_STATIC_SITE_DOMAIN
#     if static_site_domain is None:
#         connection = connect_s3(
#             settings.AWS_ACCESS_KEY_ID,
#             settings.AWS_SECRET_ACCESS_KEY
#         )
#         bucket = connection.get_bucket(settings.AWS_STORAGE_BUCKET_NAME)
#         static_site_domain = bucket.get_website_endpoint()
#     return static_site_domain.rstrip('/')


# Path: staticgen/staticgen_views.py
import logging
from django.core.urlresolvers import resolve, reverse
from django.shortcuts import resolve_url
from django.test import Client
from django.utils import translation
from django.utils.translation import ugettext_lazy as _
from .conf import settings
from .exceptions import StaticgenError
from .helpers import get_static_site_domain
from .status import is_success

# -*- coding: utf-8 -*-

from __future__ import unicode_literals




logger = logging.getLogger('staticgen')


class StaticgenView(object):
    is_paginated = False

    def __init__(self, *args, **kwargs):
        super(StaticgenView, self).__init__(*args, **kwargs)
        self.client = Client(SERVER_NAME=get_static_site_domain())

    def items(self):
        return []

    def log_error(self, message):
        logger.error(message)
        if not settings.STATICGEN_FAIL_SILENTLY:

            raise StaticgenError(message)