Parse configuration value. Returns: Tuple of (parsed_value, ConfigType)
(self, value: str)
| 145 | return |
| 146 | |
| 147 | def _parse_value(self, value: str) -> tuple: |
| 148 | """ |
| 149 | Parse configuration value. |
| 150 | |
| 151 | Returns: |
| 152 | Tuple of (parsed_value, ConfigType) |
| 153 | """ |
| 154 | if not value or value == '1': |
| 155 | return (True, ConfigType.BOOLEAN) |
| 156 | |
| 157 | # Try integer |
| 158 | try: |
| 159 | return (int(value, 0), ConfigType.INTEGER) # Support hex/octal |
| 160 | except ValueError: |
| 161 | pass |
| 162 | |
| 163 | # Try string (remove quotes) |
| 164 | if value.startswith('"') and value.endswith('"'): |
| 165 | return (value[1:-1], ConfigType.STRING) |
| 166 | |
| 167 | # Default to string |
| 168 | return (value, ConfigType.STRING) |
| 169 | |
| 170 | |
| 171 | class ConfigManager: |