<s> """<STR_LIT>""" <EOL> from __future__ import unicode_literals , absolute_import , division , print_function <EOL> from flask import Blueprint , current_app , abort , Response <EOL> from . exceptions import CompressorException <EOL> blueprint = Blueprint ( '<STR_LIT>' , __name__ ) <EOL> @ blueprint . route ( '<STR_LIT>' ) <EOL> def render_bundle ( bundle_name , bundle_hash , bundle_extension ) : <EOL> """<STR_LIT>""" <EOL> compressor = current_app . extensions [ '<STR_LIT>' ] <EOL> try : <EOL> bundle = compressor . get_bundle ( bundle_name ) <EOL> except CompressorException : <EOL> abort ( <NUM_LIT> ) <EOL> if bundle . hash != bundle_hash : <EOL> abort ( <NUM_LIT> ) <EOL> if bundle . extension != bundle_extension : <EOL> abort ( <NUM_LIT> ) <EOL> content = bundle . get_content ( ) <EOL> return Response ( content , mimetype = bundle . mimetype ) <EOL> @ blueprint . route ( '<STR_LIT>' ) <EOL> def render_asset ( bundle_name , bundle_extension , asset_index , asset_hash ) : <EOL> """<STR_LIT>""" <EOL> compressor = current_app . extensions [ '<STR_LIT>' ] <EOL> try : <EOL> bundle = compressor . get_bundle ( bundle_name ) <EOL> except CompressorException : <EOL> abort ( <NUM_LIT> ) <EOL> try : <EOL> asset = bundle . assets [ asset_index ] <EOL> except IndexError : <EOL> abort ( <NUM_LIT> ) <EOL> if asset . hash != asset_hash : <EOL> abort ( <NUM_LIT> ) <EOL> if bundle . extension != bundle_extension : <EOL> abort ( <NUM_LIT> ) <EOL> content = asset . content <EOL> return Response ( content , mimetype = bundle . mimetype ) </s>
