loader module

Loader module for NGPASM.

This module have a functional for reading config files.

class loader.ConfigType(*values)[source]

Bases: Enum

Project configuration types.

TOML = 0
YAML = 1
JSON = 2
loader.detect_config_type_by_extension(extension)[source]

Detect config type by file extension.

Parameters:

extension (str) – File extension string

Returns:

Detected config type (defaults to JSON)

Return type:

ConfigType

loader.detect_config_type_by_filename(filename)[source]

Detect config type by filename.

Parameters:

filename (str) – Full filename or path

Returns:

Detected config type

Return type:

ConfigType

class loader.ConfigReader(config_file, configtype=None)[source]

Bases: object

Project configuration reader.

Parameters:
__init__(config_file, configtype=None)[source]

Constructs new instance.

Parameters:
  • config_file (str) – Path to configuration file

  • configtype (ConfigType) – Explicit config type (auto-detected if None)