# Path: solo/web/ctx.py
# LOGGER = logging.getLogger('solo.web')
# class GreenletServing(object):
# class _ThreadLocalProxy(object):
#     def __init__(self):
#     def load(self, request, response):
#     def __getattr__(self, name):
#     def __setattr__(self, name, value):
#     def clear(self):
#     def __init__(self, attrname):
#     def __getattr__(self, name):
#     def __setattr__(self, name, value):
#     def __delattr__(self, name):
#     def _get_dict(self):
#     def __getitem__(self, key):
#     def __setitem__(self, key, value):
#     def __delitem__(self, key):
#     def __contains__(self, key):
#     def __len__(self):
#     def __nonzero__(self):


import logging
import mimetypes
import os
import os.path
from os.path import (
    getmtime,
    getsize
)
from webob import exc
from solo.web.ctx import request, response
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.





LOGGER = logging.getLogger('asset')

_BLOCK_SIZE = 4096 * 64  # 256K


class AssetController(object):

    def __init__(self, root, default_filename=None, block_size=_BLOCK_SIZE):
        self.root = root
        self.default_filename = default_filename
        self.block_size = block_size or _BLOCK_SIZE

    def get_content_type(self, absolute_path):
        mine_type, encoding = mimetypes.guess_type(absolute_path)
        mine_type = mine_type or 'application/octet-stream'
        return mine_type

    def asset(self, path):

# Path: solo/web/ctx.py
# LOGGER = logging.getLogger('solo.web')
# class GreenletServing(object):
# class _ThreadLocalProxy(object):
#     def __init__(self):
#     def load(self, request, response):
#     def __getattr__(self, name):
#     def __setattr__(self, name, value):
#     def clear(self):
#     def __init__(self, attrname):
#     def __getattr__(self, name):
#     def __setattr__(self, name, value):
#     def __delattr__(self, name):
#     def _get_dict(self):
#     def __getitem__(self, key):
#     def __setitem__(self, key, value):
#     def __delitem__(self, key):
#     def __contains__(self, key):
#     def __len__(self):
#     def __nonzero__(self):


# Path: solo/web/asset.py
import logging
import mimetypes
import os
import os.path
from os.path import (
    getmtime,
    getsize
)
from webob import exc
from solo.web.ctx import request, response

# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.





LOGGER = logging.getLogger('asset')

_BLOCK_SIZE = 4096 * 64  # 256K


class AssetController(object):

    def __init__(self, root, default_filename=None, block_size=_BLOCK_SIZE):
        self.root = root
        self.default_filename = default_filename
        self.block_size = block_size or _BLOCK_SIZE

    def get_content_type(self, absolute_path):
        mine_type, encoding = mimetypes.guess_type(absolute_path)
        mine_type = mine_type or 'application/octet-stream'
        return mine_type

    def asset(self, path):

        if request.method == 'HEAD':