How to use the stm32pio.util.Verbosity function in stm32pio

To help you get started, we’ve selected a few stm32pio examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ussserrr / stm32pio / stm32pio / util.py View on Github external
},
            special={
                'case_1': {
                    Verbosity.NORMAL: logging.Formatter(...)
                    ...
                },
                ...
            }
        }
    """

    # Mapping of logging formatters for "special". Currently, only "from_subprocess" is defined. It's good to hide such
    # implementation details as much as possible though they are still tweakable from the outer code
    special_formatters = {
        'from_subprocess': {  # TODO: maybe remade as enum, too? To have an IDE hints and more safety in general
            level: as_is_formatter for level in Verbosity
        }
    }

    def __init__(self, *args, general: Mapping[Verbosity, logging.Formatter] = None,
                 special: Mapping[str, Mapping[Verbosity, logging.Formatter]] = None,
                 verbosity: Verbosity = Verbosity.NORMAL, **kwargs):

        super().__init__(*args, **kwargs)  # will be '%(message)s' if no arguments were given

        self.verbosity = verbosity
        self._warn_was_shown = False

        if general is not None:
            self.general = general
        else:
            warnings.warn("'general' argument for DispatchingFormatter was not provided. It contains formatters for "

stm32pio

Small cross-platform Python app that can create and update PlatformIO projects from STM32CubeMX .ioc files. It uses STM32CubeMX to generate a HAL-framework-based code and alongside creates PlatformIO project with compatible parameters to stick them both together. Both CLI and GUI editions are available

MIT
Latest version published 3 years ago

Package Health Score

48 / 100
Full package analysis

Similar packages