plugin/server.py
def _lookup_server(self, view):
        '''
        Looks up an available server for the given `view`. This calculation is
        based on whether or not a server exists with a working directory
        suitable for use with the underlying file.

        If no server is available, this returns `None`.
        '''
        view_id = get_view_id(view)
        if view_id is None:
            logger.error('failed to get view id for view: %r', view)
            raise TypeError('view must be a View: %r' % (view))

        # check each cache, from fastest lookup to slowest
        if view_id in self._view_id_to_server:
            server = self._view_id_to_server[view_id]   # type: Server
            assert isinstance(server, Server), \
                '[internal] server is not a Server: %r' % (server)
            return server

        view_path = get_path_for_view(view)
        if view_path is None:
            # can't do the lookup for working directory
            logger.debug('could not get path for view, ignoring: %r', view)
        elif view_path in self._working_directory_to_server:
            # add the mapping in view id as well
            wdts = self._working_directory_to_server
            server = wdts[view_path]    # type: Server
            assert isinstance(server, Server), \
                '[internal] server is not a Server: %r' % (server)
            return server

        # not in a cache, so assume no server exists for that view
        return None

        Looks up an available server for the given `view`. This calculation is
        based on whether or not a server exists with a working directory
        suitable for use with the underlying file.

        If no server is available, this returns `None`.
        
Looks up an available server for the given `view`. This calculation is
based on whether or not a server exists with a working directory
suitable for use with the underlying file.

If no server is available, this returns `None`.
Looks up an available server for the given ` view ` . This calculation is based on whether or not a server exists with a working directory suitable for use with the underlying file . If no server is available this returns ` None ` .
def _lookup_server(self, view):
        view_id = get_view_id(view)
        if view_id is None:
            logger.error('failed to get view id for view: %r', view)
            raise TypeError('view must be a View: %r' % (view))
        if view_id in self._view_id_to_server:
            server = self._view_id_to_server[view_id]   
            assert isinstance(server, Server), \
                '[internal] server is not a Server: %r' % (server)
            return server
        view_path = get_path_for_view(view)
        if view_path is None:
            logger.debug('could not get path for view, ignoring: %r', view)
        elif view_path in self._working_directory_to_server:
            wdts = self._working_directory_to_server
            server = wdts[view_path]    
            assert isinstance(server, Server), \
                '[internal] server is not a Server: %r' % (server)
            return server
        return None
def _lookup_server ( self , view ) : view_id = get_view_id ( view ) if view_id is None : logger . error ( 'failed to get view id for view: %r' , view ) raise TypeError ( 'view must be a View: %r' % ( view ) ) if view_id in self . _view_id_to_server : server = self . _view_id_to_server [ view_id ] assert isinstance ( server , Server ) , '[internal] server is not a Server: %r' % ( server ) return server view_path = get_path_for_view ( view ) if view_path is None : logger . debug ( 'could not get path for view, ignoring: %r' , view ) elif view_path in self . _working_directory_to_server : wdts = self . _working_directory_to_server server = wdts [ view_path ] assert isinstance ( server , Server ) , '[internal] server is not a Server: %r' % ( server ) return server return None
Looks up an available server for the given `view`.
Looks up an available server for the given ` view ` .
'''
        Looks up an available server for the given `view`. This calculation is
        based on whether or not a server exists with a working directory
        suitable for use with the underlying file.

        If no server is available, this returns `None`.
        ''' # check each cache, from fastest lookup to slowest # type: Server # can't do the lookup for working directory # add the mapping in view id as well # type: Server # not in a cache, so assume no server exists for that view
self
view