Parse platformio.ini content from a string and return a fully formed instance. Args: content: INI content as string Returns: PlatformIOIni instance with the parsed configuration Raises: configparser.Error: If the content is malf
(content: str)
| 965 | |
| 966 | @staticmethod |
| 967 | def parseString(content: str) -> "PlatformIOIni": |
| 968 | """ |
| 969 | Parse platformio.ini content from a string and return a fully formed instance. |
| 970 | |
| 971 | Args: |
| 972 | content: INI content as string |
| 973 | |
| 974 | Returns: |
| 975 | PlatformIOIni instance with the parsed configuration |
| 976 | |
| 977 | Raises: |
| 978 | configparser.Error: If the content is malformed |
| 979 | """ |
| 980 | instance = object.__new__(PlatformIOIni) |
| 981 | instance.config = configparser.ConfigParser() |
| 982 | instance.file_path = None |
| 983 | |
| 984 | try: |
| 985 | instance.config.read_string(content) |
| 986 | instance._parsed_config = None # Will be lazily parsed |
| 987 | logger.debug("Successfully parsed platformio.ini from string") |
| 988 | except configparser.Error as e: |
| 989 | logger.error(f"Error parsing platformio.ini from string: {e}") |
| 990 | raise |
| 991 | |
| 992 | return instance |
| 993 | |
| 994 | @staticmethod |
| 995 | def create() -> "PlatformIOIni": |