OLD | NEW |
1 # coding: utf-8 | 1 # coding: utf-8 |
2 | 2 |
3 # This file is part of the Adblock Plus build tools, | 3 # This Source Code Form is subject to the terms of the Mozilla Public |
4 # Copyright (C) 2006-2014 Eyeo GmbH | 4 # License, v. 2.0. If a copy of the MPL was not distributed with this |
5 # | 5 # file, You can obtain one at http://mozilla.org/MPL/2.0/. |
6 # Adblock Plus is free software: you can redistribute it and/or modify | |
7 # it under the terms of the GNU General Public License version 3 as | |
8 # published by the Free Software Foundation. | |
9 # | |
10 # Adblock Plus is distributed in the hope that it will be useful, | |
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
13 # GNU General Public License for more details. | |
14 # | |
15 # You should have received a copy of the GNU General Public License | |
16 # along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>. | |
17 | 6 |
18 """ | 7 """ |
19 Update the public suffix list | 8 Update the public suffix list |
20 ============================== | 9 ============================== |
21 | 10 |
22 This script generates a js array of public suffixes (http://publicsuffix.org/) | 11 This script generates a js array of public suffixes (http://publicsuffix.org/) |
23 """ | 12 """ |
24 | 13 |
25 import os | 14 import os |
26 import urllib | 15 import urllib |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 | 50 |
62 def updatePSL(baseDir): | 51 def updatePSL(baseDir): |
63 """ | 52 """ |
64 writes the current public suffix list to js file in json format | 53 writes the current public suffix list to js file in json format |
65 """ | 54 """ |
66 | 55 |
67 psl = getPublicSuffixList() | 56 psl = getPublicSuffixList() |
68 file = open(os.path.join(baseDir, 'lib', 'publicSuffixList.js'), 'w') | 57 file = open(os.path.join(baseDir, 'lib', 'publicSuffixList.js'), 'w') |
69 print >>file, 'var publicSuffixes = ' + json.dumps(psl, sort_keys=True, indent
=4, separators=(',', ': ')) + ';' | 58 print >>file, 'var publicSuffixes = ' + json.dumps(psl, sort_keys=True, indent
=4, separators=(',', ': ')) + ';' |
70 file.close() | 59 file.close() |
OLD | NEW |