Left: | ||
Right: |
OLD | NEW |
---|---|
1 # This file is part of the Adblock Plus web scripts, | 1 # This file is part of the Adblock Plus web scripts, |
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 |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
145 except ConfigParser.Error: | 145 except ConfigParser.Error: |
146 return page | 146 return page |
147 | 147 |
148 pagelist = set() | 148 pagelist = set() |
149 blacklist = set() | 149 blacklist = set() |
150 for page, format in source.list_pages(): | 150 for page, format in source.list_pages(): |
151 for locale in locales: | 151 for locale in locales: |
152 if locale == defaultlocale: | 152 if locale == defaultlocale: |
153 pagelist.add((locale, page)) | 153 pagelist.add((locale, page)) |
154 else: | 154 else: |
155 params = get_page_params(source, locale, page, format) | 155 params = get_page_params(source, locale, page, format, |
Vasily Kuznetsov
2018/11/20 19:35:45
I think this change is not really needed: why swea
rhowell
2018/11/21 04:37:05
Winsley brought up links to stylesheets, like this
| |
156 relative=relative) | |
156 if params['translation_ratio'] >= MIN_TRANSLATED: | 157 if params['translation_ratio'] >= MIN_TRANSLATED: |
157 pagelist.add((locale, page)) | 158 pagelist.add((locale, page)) |
158 else: | 159 else: |
159 blacklist.add((locale, get_locale_file(page))) | 160 blacklist.add((locale, get_locale_file(page))) |
160 | 161 |
161 # Override existance check to avoid linking to pages we don't generate | 162 # Override existance check to avoid linking to pages we don't generate |
162 orig_has_locale = source.has_locale | 163 orig_has_locale = source.has_locale |
163 | 164 |
164 def has_locale(locale, page): | 165 def has_locale(locale, page): |
165 page = get_locale_file(page) | 166 page = get_locale_file(page) |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
203 | 204 |
204 | 205 |
205 if __name__ == '__main__': | 206 if __name__ == '__main__': |
206 parser = ArgumentParser('Convert website source to static website') | 207 parser = ArgumentParser('Convert website source to static website') |
207 parser.add_argument('source', help="Path to website's repository") | 208 parser.add_argument('source', help="Path to website's repository") |
208 parser.add_argument('output', help='Path to desired output directory') | 209 parser.add_argument('output', help='Path to desired output directory') |
209 parser.add_argument('--relative', help='Generate relative links', | 210 parser.add_argument('--relative', help='Generate relative links', |
210 action='store_true') | 211 action='store_true') |
211 args = parser.parse_args() | 212 args = parser.parse_args() |
212 generate_pages(args.source, args.output, args.relative) | 213 generate_pages(args.source, args.output, args.relative) |
OLD | NEW |