#NEWLINE# def __call__( self , request ) : #NEWLINE# #INDENT# response = self . handler ( request ) #NEWLINE# if ( request . method not in METHODS ) : #NEWLINE# #INDENT# return response #NEWLINE# #UNINDENT# if ( rendered_inclusions . content_type is None ) : #NEWLINE# #INDENT# return response #NEWLINE# #UNINDENT# if ( response . content_type . lower ( ) not in CONTENT_TYPES ) : #NEWLINE# #INDENT# return response #NEWLINE# #UNINDENT# inclusions = request . environ . get ( 'bowerstatic.inclusions' ) #NEWLINE# if ( inclusions is None ) : #NEWLINE# #INDENT# return response #NEWLINE# #UNINDENT# body = response . body #NEWLINE# response . body = b'' #NEWLINE# rendered_inclusions = ( inclusions . render ( ) + '</head>' ) . encode ( 'utf-8' ) #NEWLINE# body = body . replace ( b'</head>' , rendered_inclusions ) #NEWLINE# response . write ( body ) #NEWLINE# return response