# eric7.Plugins.CheckerPlugins.CodeStyleChecker.Imports.LocalImportVisitor

Module implementing a node visitor for checking local import statements.

### Global Attributes

None

### Classes

LocalImportVisitor | Class implementing a node visitor for checking local import statements.

### Functions

None

## LocalImportVisitor

Class implementing a node visitor for checking local import statements.

### Derived from

ast.NodeVisitor

### Class Attributes

None

### Class Methods

None

### Methods

LocalImportVisitor | Constructor
__assertExternalModule | Private method to assert the given node.
__visitImportNode | Private method to handle an import or import from statement.
visit | Public method to traverse the tree of an AST node.
visit_FunctionDef | Public method to handle a function definition.
visit_Import | Public method to handle an import statement.
visit_ImportFrom | Public method to handle an import from statement.

### Static Methods

None

#### LocalImportVisitor (Constructor)

LocalImportVisitor(args, checker)

Constructor

args (dict)
  dictionary containing the checker arguments
checker (ImportsChecker)
  reference to the checker

#### LocalImportVisitor.__assertExternalModule

__assertExternalModule(node, module)

Private method to assert the given node.

node (ast.stmt)
  reference to the node to be processed
module (str)
  name of the module

#### LocalImportVisitor.__visitImportNode

__visitImportNode(node)

Private method to handle an import or import from statement.

node (ast.Import or ast.ImportFrom)
  reference to the node to be processed

#### LocalImportVisitor.visit

visit(node)

Public method to traverse the tree of an AST node.

node (ast.AST)
  AST node to parse

#### LocalImportVisitor.visit_FunctionDef

visit_FunctionDef(node)

Public method to handle a function definition.

node (ast.FunctionDef)
  reference to the node to be processed

#### LocalImportVisitor.visit_Import

visit_Import(node)

Public method to handle an import statement.

node (ast.Import)
  reference to the node to be processed

#### LocalImportVisitor.visit_ImportFrom

visit_ImportFrom(node)

Public method to handle an import from statement.

node (ast.ImportFrom)
  reference to the node to be processed

Up