Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: mozharness/abb/transform_locales.py

Issue 29329018: Issue 3128 - The default search engine is removed if it was one of those removed by issue 3047 (moz… (Closed)
Patch Set: Removed list.txt write back Created Oct. 12, 2015, 12:59 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # This file is part of Adblock Plus 1 # This file is part of Adblock Plus
2 # Copyright (C) 2006-2015 Eyeo GmbH 2 # Copyright (C) 2006-2015 Eyeo GmbH
3 # 3 #
4 # Adblock Plus is free software: you can redistribute it and/or modify 4 # Adblock Plus is free software: you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License version 3 as 5 # it under the terms of the GNU General Public License version 3 as
6 # published by the Free Software Foundation. 6 # published by the Free Software Foundation.
7 # 7 #
8 # Adblock Plus is distributed in the hope that it will be useful, 8 # Adblock Plus is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of 9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 with open(region_file_path, "r") as fd: 129 with open(region_file_path, "r") as fd:
130 for line in fd: 130 for line in fd:
131 line = line.rstrip("\r\n") 131 line = line.rstrip("\r\n")
132 if not _SEARCH_PROPS_RE.match(line.strip()): 132 if not _SEARCH_PROPS_RE.match(line.strip()):
133 props.append(line) 133 props.append(line)
134 134
135 # Append default search engine name 135 # Append default search engine name
136 props.append("browser.search.defaultenginename=%s" % engine_order[0]) 136 props.append("browser.search.defaultenginename=%s" % engine_order[0])
137 137
138 # Append search engine order 138 # Append search engine order
139 for i in range(0, min(3, len(engine_order))): 139 for i in range(0, min(5, len(engine_order))):
140 props.append("browser.search.order.%d=%s" % (i + 1, engine_order[i])) 140 props.append("browser.search.order.%d=%s" % (i + 1, engine_order[i]))
141 141
142 # Write back list.txt
143 _write_lines(list_file_path, engine_ids)
144
145 # Write back region.properties 142 # Write back region.properties
146 _write_lines(region_file_path, props) 143 _write_lines(region_file_path, props)
147 144
148 145
149 class MinimalLogger: 146 class MinimalLogger:
150 def info(self, s): 147 def info(self, s):
151 print "INFO: %s" % s 148 print "INFO: %s" % s
152 149
153 def error(self, s): 150 def error(self, s):
154 print "ERROR: %s" % s 151 print "ERROR: %s" % s
(...skipping 16 matching lines...) Expand all
171 168
172 logger.info("Found %d locales" % len(locales)) 169 logger.info("Found %d locales" % len(locales))
173 170
174 for locale in locales: 171 for locale in locales:
175 locale_path = os.path.join(chrome_path, locale, "locale", locale) 172 locale_path = os.path.join(chrome_path, locale, "locale", locale)
176 if os.path.exists(locale_path): 173 if os.path.exists(locale_path):
177 _transform_locale(locale, locale_path, logger) 174 _transform_locale(locale, locale_path, logger)
178 else: 175 else:
179 logger.error("Missing 'locale' folder for '%s'" % locale) 176 logger.error("Missing 'locale' folder for '%s'" % locale)
180 177
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld