From d60ccb42da999988d2c595bc72bcd306beba204c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20G=C3=B6ttgens?= Date: Wed, 12 Apr 2023 10:06:04 +0200 Subject: [PATCH] pretty print --- bin/generate_ci_matrix.py | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/bin/generate_ci_matrix.py b/bin/generate_ci_matrix.py index 74ff8937..2501e83c 100755 --- a/bin/generate_ci_matrix.py +++ b/bin/generate_ci_matrix.py @@ -2,13 +2,16 @@ """Generate the CI matrix""" -import os, sys, configparser, json +import configparser +import json +import os +import sys -rootdir = 'variants/' +rootdir = "variants/" options = sys.argv[1:] -outlist=[] +outlist = [] if len(options) < 1: print(json.dumps(outlist)) @@ -16,18 +19,20 @@ if len(options) < 1: for subdir, dirs, files in os.walk(rootdir): for file in files: - if file == 'platformio.ini': + if file == "platformio.ini": config = configparser.ConfigParser() - config.read(subdir + '/' + file) + config.read(subdir + "/" + file) for c in config.sections(): - if c.startswith('env:'): + if c.startswith("env:"): section = config[c].name[4:] - if 'extends' in config[config[c].name]: - if config[config[c].name]['extends'] == options[0] + '_base': - if 'board_level' in config[config[c].name]: - if ((config[config[c].name]['board_level'] == 'extra') & ('extra' in options)): + if "extends" in config[config[c].name]: + if config[config[c].name]["extends"] == options[0] + "_base": + if "board_level" in config[config[c].name]: + if ( + config[config[c].name]["board_level"] == "extra" + ) & ("extra" in options): outlist.append(section) else: outlist.append(section) -print(json.dumps(outlist)) \ No newline at end of file +print(json.dumps(outlist))