#NEWLINE# def __call__( self , environ , start_response ) : #NEWLINE# #INDENT# path_info = environ . get ( 'PATH_INFO' , '' ) #NEWLINE# if ( not path_info ) : #NEWLINE# #INDENT# return self . add_slash ( environ , start_response ) #NEWLINE# #UNINDENT# if ( path_info == '/' ) : #NEWLINE# #INDENT# filename = 'index.html' #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# filename = request . path_info_pop ( environ ) #NEWLINE# #UNINDENT# resource = os . path . normcase ( os . path . normpath ( ( ( self . resource_name + '/' ) + filename ) ) ) #NEWLINE# if ( ( self . root_resource is not None ) and ( not resource . startswith ( self . root_resource ) ) ) : #NEWLINE# #INDENT# return self . not_found ( environ , start_response ) #NEWLINE# #UNINDENT# if ( not self . egg . has_resource ( resource ) ) : #NEWLINE# #INDENT# return self . not_found ( environ , start_response ) #NEWLINE# #UNINDENT# if self . egg . resource_isdir ( resource ) : #NEWLINE# #INDENT# child_root = ( ( ( self . root_resource is not None ) and self . root_resource ) or self . resource_name ) #NEWLINE# return self . __class__ ( self . egg , resource , self . manager , root_resource = child_root ) ( environ , start_response ) #NEWLINE# #UNINDENT# if ( environ . get ( 'PATH_INFO' ) and ( environ . get ( 'PATH_INFO' ) != '/' ) ) : #NEWLINE# #INDENT# return self . error_extra_path ( environ , start_response ) #NEWLINE# #UNINDENT# ( type , encoding ) = mimetypes . guess_type ( resource ) #NEWLINE# if ( not type ) : #NEWLINE# #INDENT# type = 'application/octet-stream' #NEWLINE# #UNINDENT# try : #NEWLINE# #INDENT# file = self . egg . get_resource_stream ( self . manager , resource ) #NEWLINE# #UNINDENT# except ( IOError , OSError ) as e : #NEWLINE# #INDENT# exc = httpexceptions . HTTPForbidden ( ( 'You are not permitted to view this file (%s)' % e ) ) #NEWLINE# return exc . wsgi_application ( environ , start_response ) #NEWLINE# #UNINDENT# start_response ( '200 OK' , [ ( 'content-type' , type ) ] ) #NEWLINE# return fileapp . _FileIter ( file )