@@ -21,7 +21,7 @@ def valid_l10n_mappings():
21
21
Returns:
22
22
The dictionary of valid l10n mappings.
23
23
"""
24
- mapping = defaultdict (set )
24
+ mapping = defaultdict (list )
25
25
region_paths = [d for d in os .listdir ("./l10n_CM/region/" )]
26
26
for region_path in region_paths :
27
27
if region_path != "Unified.json" :
@@ -30,7 +30,7 @@ def valid_l10n_mappings():
30
30
region_file = json .load (f )
31
31
if region_file .get ("sites" ):
32
32
for site in region_file .get ("sites" ):
33
- mapping [site ].add (region )
33
+ mapping [site ].append (region )
34
34
return mapping
35
35
36
36
@@ -52,14 +52,14 @@ def process_changed_file(f, selected_mappings):
52
52
region_path = os .path .join ("l10n_CM" , "region" , f"{ region } .json" )
53
53
# make sure the region mapping file exists before adding the mapping
54
54
if os .path .exists (region_path ):
55
- selected_mappings [site ].add (region )
55
+ selected_mappings [site ].append (region )
56
56
elif f .startswith (os .path .join ("l10n_CM" , "region" )):
57
57
# if a region file is changed, add the region to each site mapping.
58
58
region = split [- 1 ].split ("." )[0 ]
59
59
with open (f , "r+" ) as f :
60
60
region_file = json .load (f )
61
61
for site in region_file .get ("sites" , []):
62
- selected_mappings [site ].add (region )
62
+ selected_mappings [site ].append (region )
63
63
64
64
65
65
def save_mappings (selected_container ):
@@ -169,7 +169,7 @@ def select_l10n_mappings(beta_version):
169
169
)
170
170
main_conftest = "conftest.py"
171
171
base_page = os .path .join ("modules" , "page_base.py" )
172
- selected_mappings = defaultdict (set )
172
+ selected_mappings = defaultdict (list )
173
173
if main_conftest in committed_files or base_page in committed_files :
174
174
# Run sample tests for all mappings if main conftest or basepage changed
175
175
selected_mappings |= sample_mappings
0 commit comments