11import re
2- import sys
32from pathlib import Path # For OS-agnostic path manipulation
43from typing import Iterable
54from click import secho
65from SCons .Script import Action , Exit
7- from platformio import util
86from platformio .builder .tools .piolib import LibBuilderBase
97
108
@@ -56,8 +54,8 @@ def validate_map_file(source, target, env):
5654 Exit (1 )
5755
5856 # Identify the WLED module source directories
59- module_lib_builders = [builder for builder in env .GetLibBuilders () if is_wled_module (env , builder )]
60-
57+ module_lib_builders = [builder for builder in env .GetLibBuilders () if is_wled_module (env , builder )]
58+
6159 if env .GetProjectOption ("custom_usermods" ,"" ) == "*" :
6260 # All usermods build; filter non-platform-OK modules
6361 module_lib_builders = [builder for builder in module_lib_builders if env .IsCompatibleLibBuilder (builder )]
@@ -68,16 +66,15 @@ def validate_map_file(source, target, env):
6866 f"ERROR: Modules { [b .name for b in incompatible_builders ]} are not compatible with this platform!" ,
6967 fg = "red" ,
7068 err = True )
71- Exit (1 )
72- pass
69+ Exit (1 )
7370
7471 # Extract the values we care about
7572 modules = {Path (builder .build_dir ).name : builder .name for builder in module_lib_builders }
7673 secho (f"INFO: { len (modules )} libraries linked as WLED optional/user modules" )
7774
7875 # Now parse the map file
7976 map_file_contents = read_lines (map_file_path )
80- usermod_object_count = count_usermod_objects (map_file_contents )
77+ usermod_object_count = count_usermod_objects (map_file_contents )
8178 secho (f"INFO: { usermod_object_count } usermod object entries" )
8279
8380 confirmed_modules = check_map_file_objects (map_file_contents , modules .keys ())
0 commit comments