gecko-dev/browser/locales/searchplugins.py
Michael Kaply aa1e2c4f05 Bug 1276739 - Switch search to use a JSON based format. r=florian
MozReview-Commit-ID: 9xy3UPoRCmW

--HG--
extra : rebase_source : 235819c4f3e363ddd1deffec11d3cae6fe6c56d5
2016-05-31 13:37:26 -05:00

22 lines
593 B
Python

# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import sys
import json
engines = []
locale = sys.argv[2]
with open(sys.argv[1]) as f:
searchinfo = json.load(f)
if locale in searchinfo["locales"]:
for region in searchinfo["locales"][locale]:
engines = list(set(engines)|set(searchinfo["locales"][locale][region]["visibleDefaultEngines"]))
else:
engines = searchinfo["default"]["visibleDefaultEngines"]
print '\n'.join(engines)