browser/locales/filter.py

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rwxr-xr-x

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

michael@0 1 # This Source Code Form is subject to the terms of the Mozilla Public
michael@0 2 # License, v. 2.0. If a copy of the MPL was not distributed with this
michael@0 3 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
michael@0 4
michael@0 5 def test(mod, path, entity = None):
michael@0 6 import re
michael@0 7 # ignore anything but Firefox
michael@0 8 if mod not in ("netwerk", "dom", "toolkit", "security/manager",
michael@0 9 "browser", "browser/metro", "webapprt",
michael@0 10 "extensions/reporter", "extensions/spellcheck",
michael@0 11 "other-licenses/branding/firefox",
michael@0 12 "browser/branding/official",
michael@0 13 "services/sync"):
michael@0 14 return "ignore"
michael@0 15 if mod not in ("browser", "browser/metro", "extensions/spellcheck"):
michael@0 16 # we only have exceptions for browser, metro and extensions/spellcheck
michael@0 17 return "error"
michael@0 18 if not entity:
michael@0 19 # the only files to ignore are spell checkers and search
michael@0 20 if mod == "extensions/spellcheck":
michael@0 21 return "ignore"
michael@0 22 # browser
michael@0 23 return "ignore" if re.match(r"searchplugins\/.+\.xml", path) else "error"
michael@0 24 if mod == "extensions/spellcheck":
michael@0 25 # l10n ships en-US dictionary or something, do compare
michael@0 26 return "error"
michael@0 27 if path == "defines.inc":
michael@0 28 return "ignore" if entity == "MOZ_LANGPACK_CONTRIBUTORS" else "error"
michael@0 29
michael@0 30 if mod == "browser" and path == "chrome/browser-region/region.properties":
michael@0 31 # only region.properties exceptions remain, compare all others
michael@0 32 return ("ignore"
michael@0 33 if (re.match(r"browser\.search\.order\.[1-9]", entity) or
michael@0 34 re.match(r"browser\.contentHandlers\.types\.[0-5]", entity) or
michael@0 35 re.match(r"gecko\.handlerService\.schemes\.", entity) or
michael@0 36 re.match(r"gecko\.handlerService\.defaultHandlersVersion", entity))
michael@0 37 else "error")
michael@0 38 if mod == "browser/metro" and path == "chrome/region.properties":
michael@0 39 return ("ignore"
michael@0 40 if re.match(r"browser\.search\.order\.[1-9]", entity)
michael@0 41 else "error")
michael@0 42 return "error"

mercurial