pylint/pyreverse/inspector.py
def visit_importfrom(self, node):
        """visit an astroid.ImportFrom node

        resolve module dependencies
        """
        basename = node.modname
        context_file = node.root().file
        if context_file is not None:
            relative = modutils.is_relative(basename, context_file)
        else:
            relative = False
        for name in node.names:
            if name[0] == "*":
                continue
            # analyze dependencies
            fullname = "%s.%s" % (basename, name[0])
            if fullname.find(".") > -1:
                try:
                    # TODO: don't use get_module_part,
                    # missing package precedence
                    fullname = modutils.get_module_part(fullname, context_file)
                except ImportError:
                    continue
            if fullname != basename:
                self._imported_module(node, fullname, relative)
def visit_importfrom(self, node):
        """visit an astroid.ImportFrom node

        resolve module dependencies
        """
        basename = node.modname
        context_file = node.root().file
        if context_file is not None:
            relative = modutils.is_relative(basename, context_file)
        else:
            relative = False
        for name in node.names:
            if name[0] == "*":
                continue
            # analyze dependencies
            fullname = "%s.%s" % (basename, name[0])
            if fullname.find(".") > -1:
                try:
                    # TODO: don't use get_module_part,
                    # missing package precedence
                    fullname = modutils.get_module_part(fullname, context_file)
                except ImportError:
                    continue
            if fullname != basename:
                self._imported_module(node, fullname, relative)
def visit_importfrom ( self , node ) : basename = node . modname context_file = node . root ( ) . file if context_file is not None : relative = modutils . is_relative ( basename , context_file ) else : relative = False for name in node . names : if name [ 0 ] == "*" : continue # analyze dependencies fullname = "%s.%s" % ( basename , name [ 0 ] ) if fullname . find ( "." ) > - 1 : try : # TODO: don't use get_module_part, # missing package precedence fullname = modutils . get_module_part ( fullname , context_file ) except ImportError : continue if fullname != basename : self . _imported_module ( node , fullname , relative )
visit an astroid.ImportFrom node

        resolve module dependencies
visit an astroid . ImportFrom node