| OLD | NEW | 
|    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  Loading... | 
|  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  Loading... | 
|  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  | 
| OLD | NEW |