()
| 170 | |
| 171 | |
| 172 | def parse_s_args(): |
| 173 | for arg in options.s_args: |
| 174 | assert arg.startswith('-s') |
| 175 | arg = arg.removeprefix('-s') |
| 176 | # If not = is specified default to 1 |
| 177 | if '=' in arg: |
| 178 | key, value = arg.split('=', 1) |
| 179 | else: |
| 180 | key = arg |
| 181 | value = '1' |
| 182 | |
| 183 | # Special handling of browser version targets. A version -1 means that the specific version |
| 184 | # is not supported at all. Replace those with INT32_MAX to make it possible to compare e.g. |
| 185 | # #if MIN_FIREFOX_VERSION < 68 |
| 186 | if re.match(r'MIN_.*_VERSION', key): |
| 187 | try: |
| 188 | if int(value) < 0: |
| 189 | value = '0x7FFFFFFF' |
| 190 | except Exception: |
| 191 | pass |
| 192 | |
| 193 | key, value = normalize_boolean_setting(key, value) |
| 194 | user_settings[key] = value |
| 195 | |
| 196 | |
| 197 | def parse_args(newargs): # noqa: C901, PLR0912, PLR0915 |
no test coverage detected