soleil.loader.pre_processor#

Classes

AddTargetToLoads(path, *args, **kwargs)

Injects the _target keyword argument to load() calls and converts all assignments to _soleil_override calls.

ExtractDocStrings(*args, **kwargs)

Docstrings are only supported for classes and functions in python.

GetImportedNames(*args, **kwargs)

Keeps track of all imported names

GetPromotedName(*args, **kwargs)

Checks that a promoted name is promoted at the module level and registers the name.

ProcessClassDecorators(*args, **kwargs)

Applies some processing when a class has known decorators

ProcessModifiers(*args, **kwargs)

Applies some processing when an assignment has annotations.

ProtectKeywords(path, *args, **kwargs)

RaisesError(path, *args, **kwargs)

SoleilPreProcessor(*args, **kwargs)

TrackQualName(*args, **kwargs)

Keeps track of the latest qualified name

class soleil.loader.pre_processor.RaisesError(path, *args, **kwargs)#

Bases: NodeVisitor

class soleil.loader.pre_processor.GetImportedNames(*args, **kwargs)#

Bases: RaisesError, NodeVisitor

Keeps track of all imported names

class soleil.loader.pre_processor.TrackQualName(*args, **kwargs)#

Bases: RaisesError, NodeVisitor

Keeps track of the latest qualified name

class soleil.loader.pre_processor.ProcessClassDecorators(*args, **kwargs)#

Bases: TrackQualName, ABC

Applies some processing when a class has known decorators

class soleil.loader.pre_processor.ProcessModifiers(*args, **kwargs)#

Bases: TrackQualName, ABC

Applies some processing when an assignment has annotations.

class soleil.loader.pre_processor.GetPromotedName(*args, **kwargs)#

Bases: ProcessClassDecorators, ProcessModifiers

Checks that a promoted name is promoted at the module level and registers the name.

Keeps a dicitionary of (unpromoted) qualified names and modifiers (as strings).

property promoted_name#

The name of the promoted member

class soleil.loader.pre_processor.ExtractDocStrings(*args, **kwargs)#

Bases: TrackQualName

Docstrings are only supported for classes and functions in python. This extractor adds support for sphinx-like global/class variable documentation

class soleil.loader.pre_processor.ProtectKeywords(path, *args, **kwargs)#

Bases: RaisesError, NodeVisitor

class soleil.loader.pre_processor.AddTargetToLoads(path, *args, **kwargs)#

Bases: RaisesError, NodeTransformer

Injects the _target keyword argument to load() calls and converts all assignments to _soleil_override calls.

class soleil.loader.pre_processor.SoleilPreProcessor(*args, **kwargs)#

Bases: ProtectKeywords, GetPromotedName, GetImportedNames, AddTargetToLoads, NodeTransformer

visit(tree: Module)#

Visit a node.