# Path: staticassets/finder.py
# class BaseAssetFinder(object):
# class AssetFinder(BaseAssetFinder):
#     def find(self, path, bundle=False, **options):
#     def __init__(self):
#     def find(self, path, **options):
#     def resolve(self, path, **options):
#     def list(self):
#     def get_search_regex(self, path, content_type=None):
#     def get_cache_key(self, path, options):
# def find(*args, **kwargs):
# def resolve(*args, **kwargs):
# 
# Path: staticassets/settings.py
# DEBUG = getattr(settings, 'STATICASSETS_DEBUG', settings.DEBUG)
# MIMETYPES = {
#     '.css': 'text/css',
#     '.js': 'application/javascript'
# }
# DIRS = getattr(settings, 'STATICASSETS_DIRS', getattr(settings, 'STATICFILES_DIRS'))
# CACHE_DIR = os.path.join(getattr(settings, 'STATIC_ROOT', '/tmp'), 'staticassets-cache')
# FINDER = getattr(settings, 'STATICASSETS_FINDER', 'staticassets.finder.AssetFinder')
# PREPROCESSORS = getattr(settings, 'STATICASSETS_PREPROCESSORS', (
#     ('application/javascript', 'staticassets.processors.DirectiveProcessor'),
#     ('text/css', 'staticassets.processors.DirectiveProcessor')
# ))
# POSTPROCESSORS = getattr(settings, 'STATICASSETS_POSTPROCESSORS', (
#     ('text/css', 'staticassets.processors.ResolvePathsProcessor'),
#     ('application/javascript', 'staticassets.processors.CommonjsProcessor'),
# ))
# BUNDLEPROCESSORS = getattr(settings, 'STATICASSETS_BUNDLEPROCESSORS', tuple())
# COMPILERS = {
#     '.sass': 'staticassets.compilers.Sass',
#     '.scss': 'staticassets.compilers.Sass',
#     '.styl': 'staticassets.compilers.Stylus',
#     '.less': 'staticassets.compilers.Less',
#     '.jst': 'staticassets.compilers.Jst',
#     '.ejs': 'staticassets.compilers.Ejs',
#     '.coffee': 'staticassets.compilers.CoffeeScript'
# }
# COMPRESSION = getattr(settings, 'STATICASSETS_COMPRESSION', not DEBUG)
# COMPRESSORS = {
#     'application/javascript': 'staticassets.compressors.UglifyJSCompressor',
#     'text/css': 'staticassets.compressors.YUICompressor'
# }
# AVAILABLE_EXTENSIONS = MIMETYPES.keys() + COMPILERS.keys()
# MANIFESTS = getattr(settings, 'STATICASSETS_MANIFESTS', tuple())
# EJS_TEMPLATE_SETTINGS = getattr(settings, 'STATICASSETS_EJS_TEMPLATE_SETTINGS', '{}')
# 
# Path: staticassets/exceptions.py
# class AssetNotFound(Exception):
#     pass


import mimetypes
from django.conf import settings as django_settings
from django.http import HttpResponse, HttpResponseNotModified, Http404
from django.contrib.staticfiles.views import serve as staticfiles_serve
from django.views import static
from staticassets import finder, settings
from .exceptions import AssetNotFound




def serve(request, path, **kwargs):
    mimetype, encoding = mimetypes.guess_type(path)
    if not mimetype in settings.MIMETYPES.values():
        try:
            return staticfiles_serve(request, path, **kwargs)
        except Http404:
            return static.serve(request, path, document_root=django_settings.STATIC_ROOT)


# Path: staticassets/finder.py
# class BaseAssetFinder(object):
# class AssetFinder(BaseAssetFinder):
#     def find(self, path, bundle=False, **options):
#     def __init__(self):
#     def find(self, path, **options):
#     def resolve(self, path, **options):
#     def list(self):
#     def get_search_regex(self, path, content_type=None):
#     def get_cache_key(self, path, options):
# def find(*args, **kwargs):
# def resolve(*args, **kwargs):
# 
# Path: staticassets/settings.py
# DEBUG = getattr(settings, 'STATICASSETS_DEBUG', settings.DEBUG)
# MIMETYPES = {
#     '.css': 'text/css',
#     '.js': 'application/javascript'
# }
# DIRS = getattr(settings, 'STATICASSETS_DIRS', getattr(settings, 'STATICFILES_DIRS'))
# CACHE_DIR = os.path.join(getattr(settings, 'STATIC_ROOT', '/tmp'), 'staticassets-cache')
# FINDER = getattr(settings, 'STATICASSETS_FINDER', 'staticassets.finder.AssetFinder')
# PREPROCESSORS = getattr(settings, 'STATICASSETS_PREPROCESSORS', (
#     ('application/javascript', 'staticassets.processors.DirectiveProcessor'),
#     ('text/css', 'staticassets.processors.DirectiveProcessor')
# ))
# POSTPROCESSORS = getattr(settings, 'STATICASSETS_POSTPROCESSORS', (
#     ('text/css', 'staticassets.processors.ResolvePathsProcessor'),
#     ('application/javascript', 'staticassets.processors.CommonjsProcessor'),
# ))
# BUNDLEPROCESSORS = getattr(settings, 'STATICASSETS_BUNDLEPROCESSORS', tuple())
# COMPILERS = {
#     '.sass': 'staticassets.compilers.Sass',
#     '.scss': 'staticassets.compilers.Sass',
#     '.styl': 'staticassets.compilers.Stylus',
#     '.less': 'staticassets.compilers.Less',
#     '.jst': 'staticassets.compilers.Jst',
#     '.ejs': 'staticassets.compilers.Ejs',
#     '.coffee': 'staticassets.compilers.CoffeeScript'
# }
# COMPRESSION = getattr(settings, 'STATICASSETS_COMPRESSION', not DEBUG)
# COMPRESSORS = {
#     'application/javascript': 'staticassets.compressors.UglifyJSCompressor',
#     'text/css': 'staticassets.compressors.YUICompressor'
# }
# AVAILABLE_EXTENSIONS = MIMETYPES.keys() + COMPILERS.keys()
# MANIFESTS = getattr(settings, 'STATICASSETS_MANIFESTS', tuple())
# EJS_TEMPLATE_SETTINGS = getattr(settings, 'STATICASSETS_EJS_TEMPLATE_SETTINGS', '{}')
# 
# Path: staticassets/exceptions.py
# class AssetNotFound(Exception):
#     pass


# Path: staticassets/views.py
import mimetypes
from django.conf import settings as django_settings
from django.http import HttpResponse, HttpResponseNotModified, Http404
from django.contrib.staticfiles.views import serve as staticfiles_serve
from django.views import static
from staticassets import finder, settings
from .exceptions import AssetNotFound





def serve(request, path, **kwargs):
    mimetype, encoding = mimetypes.guess_type(path)
    if not mimetype in settings.MIMETYPES.values():
        try:
            return staticfiles_serve(request, path, **kwargs)
        except Http404:
            return static.serve(request, path, document_root=django_settings.STATIC_ROOT)


    bundle = request.GET.get('bundle') in ('1', 't', 'true') or not settings.DEBUG