#NEWLINE# def __call__( self , environ , start_response ) : #NEWLINE# #INDENT# environ [ 'paste.urlparser.base_python_name' ] = self . base_python_name #NEWLINE# if ( self . init_module is NoDefault ) : #NEWLINE# #INDENT# self . init_module = self . find_init_module ( environ ) #NEWLINE# #UNINDENT# path_info = environ . get ( 'PATH_INFO' , '' ) #NEWLINE# if ( not path_info ) : #NEWLINE# #INDENT# return self . add_slash ( environ , start_response ) #NEWLINE# #UNINDENT# if ( self . init_module and getattr ( self . init_module , 'urlparser_hook' , None ) ) : #NEWLINE# #INDENT# self . init_module . urlparser_hook ( environ ) #NEWLINE# #UNINDENT# orig_path_info = environ [ 'PATH_INFO' ] #NEWLINE# orig_script_name = environ [ 'SCRIPT_NAME' ] #NEWLINE# ( application , filename ) = self . find_application ( environ ) #NEWLINE# if ( not application ) : #NEWLINE# #INDENT# if ( self . init_module and getattr ( self . init_module , 'not_found_hook' , None ) and ( environ . get ( 'paste.urlparser.not_found_parser' ) is not self ) ) : #NEWLINE# #INDENT# not_found_hook = self . init_module . not_found_hook #NEWLINE# environ [ 'paste.urlparser.not_found_parser' ] = self #NEWLINE# environ [ 'PATH_INFO' ] = orig_path_info #NEWLINE# environ [ 'SCRIPT_NAME' ] = orig_script_name #NEWLINE# return not_found_hook ( environ , start_response ) #NEWLINE# #UNINDENT# if ( filename is None ) : #NEWLINE# #INDENT# ( name , rest_of_path ) = request . path_info_split ( environ [ 'PATH_INFO' ] ) #NEWLINE# if ( not name ) : #NEWLINE# #INDENT# name = ( 'one of %s' % ', ' . join ( ( self . index_names or [ '(no index_names defined)' ] ) ) ) #NEWLINE# #UNINDENT# return self . not_found ( environ , start_response , ( 'Tried to load %s from directory %s' % ( name , self . directory ) ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# environ [ 'wsgi.errors' ] . write ( ( 'Found resource %s, but could not construct application\n' % name ) ) #NEWLINE# return self . not_found ( environ , start_response , ( 'Tried to load %s from directory %s' % ( filename , self . directory ) ) ) #NEWLINE# #UNINDENT# #UNINDENT# if ( self . init_module and getattr ( self . init_module , 'urlparser_wrap' , None ) ) : #NEWLINE# #INDENT# return self . init_module . urlparser_wrap ( environ , start_response , application ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# return application ( environ , start_response )