How to use the stm32pio.util.get_platformio_boards 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 / tests / test_unit.py View on Github external
def test_get_platformio_boards(self):
        """
        PlatformIO identifiers of boards are requested using PlatformIO CLI in JSON format
        """
        self.assertIsInstance(stm32pio.util.get_platformio_boards(platformio_cmd='platformio'), list)
github ussserrr / stm32pio / stm32pio_gui / app.py View on Github external
def loading():
        boards = ['None'] + stm32pio.util.get_platformio_boards('platformio')
        boards_model.setStringList(boards)
github ussserrr / stm32pio / stm32pio / lib.py View on Github external
path = pathlib.Path(dirty_path).expanduser().resolve(strict=True)
        ioc_file = None
        if path.is_file() and path.suffix == '.ioc':  # if .ioc file was supplied instead of the directory
            ioc_file = path
            path = path.parent
        self.path = path

        self.config = self._load_config(parameters)

        self.ioc_file = self._find_ioc_file(explicit_file=ioc_file)
        self.config.set('project', 'ioc_file', self.ioc_file.name)  # save only the name of file to the config

        # Notify the caller about the board presence
        if 'board' in parameters and parameters['board'] is not None:
            try:
                boards = stm32pio.util.get_platformio_boards(self.config.get('app', 'platformio_cmd'))
            except Exception as e:
                self.logger.warning(f"There was an error while obtaining possible PlatformIO boards: {e}",
                                    exc_info=self.logger.isEnabledFor(logging.DEBUG))
                boards = []
            if parameters['board'] not in boards:
                self.logger.warning(f"'{parameters['board']}' was not found in PlatformIO. "
                                    "Run 'platformio boards' for possible names")

        # Save the config on an instance destruction
        if instance_options['save_on_destruction']:
            self._finalizer = weakref.finalize(self, self._save_config, self.config, self.path, self.logger)

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