Visitor Module
- class cli_command_parser.conversion.visitor.ScriptVisitor(smart_loop_handling: bool = True, track_refs: Collection[TrackedRef] = ())[source]
Bases:
NodeVisitor
- visit_FunctionDef
- visit_AsyncFunctionDef
- visit_Lambda
- visit_ClassDef
- visit_While
- track_refs_to(ref: TrackedRef)[source]
- visit_ImportFrom(node: ImportFrom)[source]
Processes a
from module import names
statement. If the module name matches one from which members were registered to be tracked, then the imported names (and anyas
aliases) are processed. Members with canonical names that match an item that was registered to be tracked are added to the current scope / variable namespace.Relative module imports are handled fuzzily - no attempt is made to determine the fully qualified module name for the source file or to resolve what the relative import’s fully qualified module name would be. This may result in incorrect items being tracked if the name matched a tracked name in the matched tracked module.