gws.spec.generator.normalizer

Normalize parsed types: resolve aliases, evaluate defaults and complete classes.

Source code: gws.spec.generator.normalizer

Module Contents

gws.spec.generator.normalizer.COMMA = ','
gws.spec.generator.normalizer.DOT = '.'
gws.spec.generator.normalizer.normalize(gen: gws.spec.generator.base.Generator)

Normalize the parsed types in place.

The steps are:

  • add aliases gws.Name for names defined in the modules listed in GLOBAL_MODULES,

  • expand alias chains and replace alias references with the target uids,

  • evaluate default expressions (constants and enum members) to values,

  • create a VARIANT type for each gws.ext category, e.g. gws.ext.object.layer with members qgis, wms and so on,

  • add a type property to each gws.ext.config and gws.ext.props class,

  • warn about undefined gws types,

  • collect the own and inherited properties of each class into tProperties.

Parameters:

gen – Generator state.

Raises:

GeneratorError – On circular aliases or circular inheritance.