File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed
Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change 1+ import configparser
12import re
23import logging
34import sys
@@ -31,12 +32,9 @@ def read_platformio_ini_file(logic_state: LogicState) -> List[str]:
3132
3233
3334def get_pio_environments (ini_lines : List [str ]) -> List [PioEnv ]:
34- environment_lines = [ini_line for ini_line in ini_lines if ini_line .startswith ('[env:' )]
35- raw_pio_envs = []
36- for environment_line in environment_lines :
37- match = re .search (r'\[env:(.+)\]' , environment_line )
38- if match :
39- raw_pio_envs .append (match .group (1 ))
35+ platformio_ini = configparser .ConfigParser ()
36+ platformio_ini .read_string ('' .join (ini_lines ))
37+ raw_pio_envs = [s .split (':' , maxsplit = 1 )[1 ] for s in platformio_ini .sections () if s .startswith ('env:' )]
4038 log .info (f'Found pio environments: { raw_pio_envs } ' )
4139
4240 # we don't want to build native
You can’t perform that action at this time.
0 commit comments