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

Delta Between Two Patch Sets: mozharness/abb/transform_locales.py

Issue 29628702: Issue 6076 - Remove old search engine ordering logic (Closed)
Left Patch Set: Created Dec. 4, 2017, 9:09 a.m.
Right Patch Set: Removed obsolete shutil import Created Dec. 5, 2017, 10:47 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « mozharness/abb/ecosia.xml ('k') | no next file » | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 # This file is part of Adblock Plus 1 # This file is part of Adblock Plus
2 # Copyright (C) 2006-present eyeo GmbH 2 # Copyright (C) 2006-present 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
11 # GNU General Public License for more details. 11 # GNU General Public License for more details.
12 # 12 #
13 # You should have received a copy of the GNU General Public License 13 # You should have received a copy of the GNU General Public License
14 # along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>. 14 # along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>.
15 15
16 import os 16 import os
17 import re 17 import re
18 import shutil
19 import sys 18 import sys
20 19
21 _LOCALE_RE = re.compile("^([a-z]{2,3}(?:-[A-Z]{2})?)$") 20 _LOCALE_RE = re.compile("^([a-z]{2,3}(?:-[A-Z]{2})?)$")
22 _VALUES_LOCALE_RE = re.compile("^values-([a-z]{2,3}(?:-r[A-Z]{2})?)$") 21 _VALUES_LOCALE_RE = re.compile("^values-([a-z]{2,3}(?:-r[A-Z]{2})?)$")
23 22
24 _PROPERTY_FORMAT_RE = re.compile("^(([^=]*)=)(.*)$") 23 _PROPERTY_FORMAT_RE = re.compile("^(([^=]*)=)(.*)$")
25 _ENTITY_FORMAT_RE = re.compile("^(\s*<!ENTITY\s*([^\"\s]*)\s*\")(.*)(\">)$") 24 _ENTITY_FORMAT_RE = re.compile("^(\s*<!ENTITY\s*([^\"\s]*)\s*\")(.*)(\">)$")
26 _STRING_FORMAT_RE = re.compile( 25 _STRING_FORMAT_RE = re.compile(
27 "^(\s*<string name=\"([^\"]*)\">)(.*)(</string>)$") 26 "^(\s*<string name=\"([^\"]*)\">)(.*)(</string>)$")
28 27
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 if os.path.exists(locale_path): 222 if os.path.exists(locale_path):
224 _transform_locale(locale, locale_path, logger) 223 _transform_locale(locale, locale_path, logger)
225 _generate_browser_search(locale, locale_path, res_path, build_dir) 224 _generate_browser_search(locale, locale_path, res_path, build_dir)
226 else: 225 else:
227 logger.error("Missing folder for locale '%s' in path: %s" % 226 logger.error("Missing folder for locale '%s' in path: %s" %
228 (locale, locale_path)) 227 (locale, locale_path))
229 228
230 for locale in values_locales: 229 for locale in values_locales:
231 locale_path = os.path.join(res_path, "values-" + locale) 230 locale_path = os.path.join(res_path, "values-" + locale)
232 _transform_values_locale(locale, locale_path, logger) 231 _transform_values_locale(locale, locale_path, logger)
LEFTRIGHT

Powered by Google App Engine
This is Rietveld