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: Skipping writing back of 'list.txt' Created Oct. 9, 2015, 4:38 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 # We're skipping this step, though I want to have that line included here,
Felix Dahlke 2015/10/12 11:20:18 Why keep the line? We can retrieve it from hg log
René Jeschke 2015/10/12 12:59:59 Done.
143 # so I only commented out writing back of list.txt.
144 # See https://issues.adblockplus.org/ticket/3128
142 # Write back list.txt 145 # Write back list.txt
143 _write_lines(list_file_path, engine_ids) 146 # _write_lines(list_file_path, engine_ids)
144 147
145 # Write back region.properties 148 # Write back region.properties
146 _write_lines(region_file_path, props) 149 _write_lines(region_file_path, props)
147 150
148 151
149 class MinimalLogger: 152 class MinimalLogger:
150 def info(self, s): 153 def info(self, s):
151 print "INFO: %s" % s 154 print "INFO: %s" % s
152 155
153 def error(self, s): 156 def error(self, s):
(...skipping 17 matching lines...) Expand all
171 174
172 logger.info("Found %d locales" % len(locales)) 175 logger.info("Found %d locales" % len(locales))
173 176
174 for locale in locales: 177 for locale in locales:
175 locale_path = os.path.join(chrome_path, locale, "locale", locale) 178 locale_path = os.path.join(chrome_path, locale, "locale", locale)
176 if os.path.exists(locale_path): 179 if os.path.exists(locale_path):
177 _transform_locale(locale, locale_path, logger) 180 _transform_locale(locale, locale_path, logger)
178 else: 181 else:
179 logger.error("Missing 'locale' folder for '%s'" % locale) 182 logger.error("Missing 'locale' folder for '%s'" % locale)
180 183
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