🔨 Build scripts cleanup (#27157)

Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
This commit is contained in:
Andrew 2024-06-14 17:01:34 -04:00 committed by GitHub
parent ae2843940f
commit 959be66cc2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
41 changed files with 130 additions and 151 deletions

View file

@ -11,7 +11,7 @@ def blab(str,level=1):
if verbose >= level: print(f"[config] {str}")
def config_path(cpath):
return Path("Marlin", cpath, encoding='utf-8')
return Path("Marlin", cpath)
# Apply a single name = on/off ; name = value ; etc.
# TODO: Limit to the given (optional) configuration
@ -223,7 +223,7 @@ def apply_config_ini(cp):
sect = 'base'
if '@' in ckey: sect, ckey = map(str.strip, ckey.split('@'))
cp2 = configparser.ConfigParser()
cp2.read(config_path(ckey))
cp2.read(config_path(ckey), encoding='utf-8')
apply_sections(cp2, sect)
ckey = 'base'
@ -270,7 +270,7 @@ if __name__ == "__main__":
if ini_file:
user_ini = configparser.ConfigParser()
user_ini.read(ini_file)
user_ini.read(ini_file, encoding='utf-8')
apply_config_ini(user_ini)
else:
@ -279,11 +279,8 @@ else:
#
import pioutil
if pioutil.is_pio_build():
Import("env")
try:
verbose = int(env.GetProjectOption('custom_verbose'))
verbose = int(pioutil.env.GetProjectOption('custom_verbose'))
except:
pass