prefpicker 1.23.7__py3-none-any.whl → 1.24.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of prefpicker might be problematic. Click here for more details.
- prefpicker/main.py +3 -3
- prefpicker/prefpicker.py +12 -9
- prefpicker/templates/browser-fuzzing.yml +7 -0
- {prefpicker-1.23.7.dist-info → prefpicker-1.24.1.dist-info}/METADATA +3 -3
- {prefpicker-1.23.7.dist-info → prefpicker-1.24.1.dist-info}/RECORD +9 -9
- {prefpicker-1.23.7.dist-info → prefpicker-1.24.1.dist-info}/WHEEL +1 -1
- {prefpicker-1.23.7.dist-info → prefpicker-1.24.1.dist-info}/LICENSE +0 -0
- {prefpicker-1.23.7.dist-info → prefpicker-1.24.1.dist-info}/entry_points.txt +0 -0
- {prefpicker-1.23.7.dist-info → prefpicker-1.24.1.dist-info}/top_level.txt +0 -0
prefpicker/main.py
CHANGED
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
3
3
|
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
4
4
|
"""prefpicker module main"""
|
|
5
|
+
from __future__ import annotations
|
|
5
6
|
|
|
6
7
|
from argparse import ArgumentParser, Namespace
|
|
7
8
|
from logging import DEBUG, INFO, basicConfig, getLogger
|
|
8
9
|
from os import getenv
|
|
9
10
|
from pathlib import Path
|
|
10
|
-
from typing import List, Optional
|
|
11
11
|
|
|
12
12
|
from .prefpicker import PrefPicker, SourceDataError, __version__
|
|
13
13
|
|
|
@@ -17,7 +17,7 @@ __credits__ = ["Tyson Smith"]
|
|
|
17
17
|
LOG = getLogger(__name__)
|
|
18
18
|
|
|
19
19
|
|
|
20
|
-
def parse_args(argv:
|
|
20
|
+
def parse_args(argv: list[str] | None = None) -> Namespace:
|
|
21
21
|
"""Handle argument parsing.
|
|
22
22
|
|
|
23
23
|
Args:
|
|
@@ -64,7 +64,7 @@ def parse_args(argv: Optional[List[str]] = None) -> Namespace:
|
|
|
64
64
|
return args
|
|
65
65
|
|
|
66
66
|
|
|
67
|
-
def main(argv:
|
|
67
|
+
def main(argv: list[str] | None = None) -> int:
|
|
68
68
|
"""
|
|
69
69
|
PrefPicker main entry point
|
|
70
70
|
|
prefpicker/prefpicker.py
CHANGED
|
@@ -2,13 +2,14 @@
|
|
|
2
2
|
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
3
3
|
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
4
4
|
"""prefpicker module"""
|
|
5
|
+
from __future__ import annotations
|
|
5
6
|
|
|
6
7
|
from datetime import datetime, timezone
|
|
7
8
|
from importlib.metadata import PackageNotFoundError, version
|
|
8
9
|
from json import dumps
|
|
9
10
|
from pathlib import Path
|
|
10
11
|
from random import choice
|
|
11
|
-
from typing import Any, Dict, Iterator, List,
|
|
12
|
+
from typing import Any, Dict, Iterator, List, Union
|
|
12
13
|
|
|
13
14
|
from yaml import safe_load
|
|
14
15
|
from yaml.parser import ParserError
|
|
@@ -27,7 +28,9 @@ class SourceDataError(Exception):
|
|
|
27
28
|
"""This is raised when issues are found in the source data."""
|
|
28
29
|
|
|
29
30
|
|
|
30
|
-
|
|
31
|
+
# Python <= 3.9 requires the use of Union
|
|
32
|
+
PrefValue = Union[bool, int, str, None]
|
|
33
|
+
# Python 3.8 requires typing.Dict and typing.List even with __future__.annotations here
|
|
31
34
|
PrefVariant = Dict[str, List[PrefValue]]
|
|
32
35
|
|
|
33
36
|
|
|
@@ -35,10 +38,10 @@ class PrefPicker: # pylint: disable=missing-docstring
|
|
|
35
38
|
__slots__ = ("prefs", "variants")
|
|
36
39
|
|
|
37
40
|
def __init__(self) -> None:
|
|
38
|
-
self.prefs:
|
|
39
|
-
self.variants:
|
|
41
|
+
self.prefs: dict[str, dict[str, PrefVariant]] = {}
|
|
42
|
+
self.variants: set[str] = {"default"}
|
|
40
43
|
|
|
41
|
-
def check_combinations(self) -> Iterator[
|
|
44
|
+
def check_combinations(self) -> Iterator[tuple[str, int]]:
|
|
42
45
|
"""Count the number of combinations for each variation. Only return
|
|
43
46
|
variants that have more than one combination.
|
|
44
47
|
|
|
@@ -60,7 +63,7 @@ class PrefPicker: # pylint: disable=missing-docstring
|
|
|
60
63
|
if count > 1:
|
|
61
64
|
yield (variant, count)
|
|
62
65
|
|
|
63
|
-
def check_duplicates(self) -> Iterator[
|
|
66
|
+
def check_duplicates(self) -> Iterator[tuple[str, str]]:
|
|
64
67
|
"""Look for variants with values that appear more than once per variant.
|
|
65
68
|
|
|
66
69
|
Args:
|
|
@@ -75,7 +78,7 @@ class PrefPicker: # pylint: disable=missing-docstring
|
|
|
75
78
|
if len(variants[variant]) != len(set(variants[variant])):
|
|
76
79
|
yield (pref, variant)
|
|
77
80
|
|
|
78
|
-
def check_overwrites(self) -> Iterator[
|
|
81
|
+
def check_overwrites(self) -> Iterator[tuple[str, str, PrefValue]]:
|
|
79
82
|
"""Look for variants that overwrite the default with the same value.
|
|
80
83
|
|
|
81
84
|
Args:
|
|
@@ -145,7 +148,7 @@ class PrefPicker: # pylint: disable=missing-docstring
|
|
|
145
148
|
prefs_fp.write(f'user_pref("{pref}", {sanitized});\n')
|
|
146
149
|
|
|
147
150
|
@classmethod
|
|
148
|
-
def lookup_template(cls, name: str) ->
|
|
151
|
+
def lookup_template(cls, name: str) -> Path | None:
|
|
149
152
|
"""Lookup built-in template Path.
|
|
150
153
|
|
|
151
154
|
Args:
|
|
@@ -160,7 +163,7 @@ class PrefPicker: # pylint: disable=missing-docstring
|
|
|
160
163
|
return None
|
|
161
164
|
|
|
162
165
|
@classmethod
|
|
163
|
-
def load_template(cls, input_yml: Path) ->
|
|
166
|
+
def load_template(cls, input_yml: Path) -> PrefPicker:
|
|
164
167
|
"""Load data from a template YAML file.
|
|
165
168
|
|
|
166
169
|
Args:
|
|
@@ -1081,6 +1081,13 @@ pref:
|
|
|
1081
1081
|
variants:
|
|
1082
1082
|
default:
|
|
1083
1083
|
- ''
|
|
1084
|
+
webgl.colorspaces.prototype:
|
|
1085
|
+
review_on_close:
|
|
1086
|
+
- 1885491
|
|
1087
|
+
variants:
|
|
1088
|
+
default:
|
|
1089
|
+
- false
|
|
1090
|
+
- true
|
|
1084
1091
|
webgl.enable-draft-extensions:
|
|
1085
1092
|
variants:
|
|
1086
1093
|
default:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: prefpicker
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.24.1
|
|
4
4
|
Summary: PrefPicker - Manage & generate prefs.js files
|
|
5
5
|
Home-page: https://github.com/MozillaSecurity/prefpicker
|
|
6
6
|
Author: Tyson Smith
|
|
@@ -17,8 +17,8 @@ Description-Content-Type: text/markdown
|
|
|
17
17
|
License-File: LICENSE
|
|
18
18
|
Requires-Dist: PyYAML
|
|
19
19
|
Provides-Extra: dev
|
|
20
|
-
Requires-Dist: pre-commit
|
|
21
|
-
Requires-Dist: tox
|
|
20
|
+
Requires-Dist: pre-commit; extra == "dev"
|
|
21
|
+
Requires-Dist: tox; extra == "dev"
|
|
22
22
|
|
|
23
23
|
PrefPicker
|
|
24
24
|
==========
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
prefpicker/__init__.py,sha256=XWsqb0fPEcXI12OFAGU0ftCAiUAnNTyyAzADC62x1-g,348
|
|
2
2
|
prefpicker/__main__.py,sha256=8-D6LzRgVF2PwY7XXs1Fs-Nzy0NPOl04DKMmk18SqsU,282
|
|
3
|
-
prefpicker/main.py,sha256=
|
|
4
|
-
prefpicker/prefpicker.py,sha256=
|
|
3
|
+
prefpicker/main.py,sha256=LYFyGmvJKRJauFI5PzEx41ajwi-gNmtdkvyONAl4ff4,3841
|
|
4
|
+
prefpicker/prefpicker.py,sha256=OiQ7qSerQ3Ej73aKMD-H8kwG4Rna4stugz_S74FPMuA,9899
|
|
5
5
|
prefpicker/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
6
6
|
prefpicker/test_main.py,sha256=6K4eKDvXwy7ogdj-tOKIfjCJjr0CnQwfFyobjpj4hgk,2644
|
|
7
7
|
prefpicker/test_prefpicker.py,sha256=ag16_Stw_dsMYyPIsg-TU_TFHHLOirO1aSiBd633oO0,9265
|
|
8
8
|
prefpicker/test_templates.py,sha256=jlu3QTWzn1iE_7ljQs3byBAvUaGjeFZPNuBySSvSUoM,1496
|
|
9
|
-
prefpicker/templates/browser-fuzzing.yml,sha256=
|
|
9
|
+
prefpicker/templates/browser-fuzzing.yml,sha256=uWePYp0J3w2-SNUc8A8dhAVGYkWe7dmkWLxdBYM7cWw,22508
|
|
10
10
|
prefpicker/templates/schema.json,sha256=4WJVuGrxSQHk2CrT5QOZ7SRnTPgK2Dxr4e4LYOmMWyo,898
|
|
11
|
-
prefpicker-1.
|
|
12
|
-
prefpicker-1.
|
|
13
|
-
prefpicker-1.
|
|
14
|
-
prefpicker-1.
|
|
15
|
-
prefpicker-1.
|
|
16
|
-
prefpicker-1.
|
|
11
|
+
prefpicker-1.24.1.dist-info/LICENSE,sha256=HyVuytGSiAUQ6ErWBHTqt1iSGHhLmlC8fO7jTCuR8dU,16725
|
|
12
|
+
prefpicker-1.24.1.dist-info/METADATA,sha256=_Y8XWJgc0nOOiz36iZaLptZlUSViw2v0SGMAix3gCLQ,5106
|
|
13
|
+
prefpicker-1.24.1.dist-info/WHEEL,sha256=cVxcB9AmuTcXqmwrtPhNK88dr7IR_b6qagTj0UvIEbY,91
|
|
14
|
+
prefpicker-1.24.1.dist-info/entry_points.txt,sha256=og57vebqGVtgg_OZGO39WUb13H8wMzcnNBh4h-t26K0,52
|
|
15
|
+
prefpicker-1.24.1.dist-info/top_level.txt,sha256=H-QqR-VZXNwG4ya7wnqx5NA-yua6D9uQuBquP2zCRbc,11
|
|
16
|
+
prefpicker-1.24.1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|