LEFT | RIGHT |
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 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 found = False | 193 found = False |
194 for key in group: | 194 for key in group: |
195 if self._data[key] != None: | 195 if self._data[key] != None: |
196 found = True | 196 found = True |
197 if not found: | 197 if not found: |
198 str = ', '.join(group) | 198 str = ', '.join(group) |
199 warn('None of the attributes %s present in %s' % (str, path)) | 199 warn('None of the attributes %s present in %s' % (str, path)) |
200 | 200 |
201 if len(self.variants) == 0: | 201 if len(self.variants) == 0: |
202 warn('No list locations given in %s' % path) | 202 warn('No list locations given in %s' % path) |
203 if self.type not in ('ads', 'anti-adblock', 'circumvention', 'other', 'm
alware', 'social', 'privacy'): | 203 if self.type not in ('ads', 'anti-adblock', 'circumvention', 'other', |
| 204 'malware', 'social', 'privacy'): |
204 warn('Unknown type given in %s' % path) | 205 warn('Unknown type given in %s' % path) |
205 if self.digest != 'daily' and self.digest != 'weekly': | 206 if self.digest != 'daily' and self.digest != 'weekly': |
206 warn('Unknown digest frequency given in %s' % path) | 207 warn('Unknown digest frequency given in %s' % path) |
207 if not self.digestDay[0:3].lower() in weekdays: | 208 if not self.digestDay[0:3].lower() in weekdays: |
208 warn('Unknown digest day given in %s' % path) | 209 warn('Unknown digest day given in %s' % path) |
209 self.digestDay = 'wed' | 210 self.digestDay = 'wed' |
210 self.digestDay = weekdays[self.digestDay[0:3].lower()] | 211 self.digestDay = weekdays[self.digestDay[0:3].lower()] |
211 if self.recommendation is not None and self.type == 'ads' and not (self.
languages and self.languages.strip()): | 212 if self.recommendation is not None and self.type == 'ads' and not (self.
languages and self.languages.strip()): |
212 warn('Recommendation without languages in %s' % path) | 213 warn('Recommendation without languages in %s' % path) |
213 if len(self.supplements) == 0: | 214 if len(self.supplements) == 0: |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
265 def getFallbackData(): | 266 def getFallbackData(): |
266 repo = os.path.abspath(get_config().get('subscriptions', 'repository')) | 267 repo = os.path.abspath(get_config().get('subscriptions', 'repository')) |
267 redirectdata = subprocess.check_output(['hg', '-R', repo, 'cat', '-r', 'defa
ult', os.path.join(repo, 'redirects')]) | 268 redirectdata = subprocess.check_output(['hg', '-R', repo, 'cat', '-r', 'defa
ult', os.path.join(repo, 'redirects')]) |
268 gonedata = subprocess.check_output(['hg', '-R', repo, 'cat', '-r', 'default'
, os.path.join(repo, 'gone')]) | 269 gonedata = subprocess.check_output(['hg', '-R', repo, 'cat', '-r', 'default'
, os.path.join(repo, 'gone')]) |
269 return (redirectdata, gonedata) | 270 return (redirectdata, gonedata) |
270 | 271 |
271 | 272 |
272 def _validate_URL(url): | 273 def _validate_URL(url): |
273 parse_result = urlparse(url) | 274 parse_result = urlparse(url) |
274 return parse_result.scheme in ('http', 'https') and parse_result.netloc != '
' | 275 return parse_result.scheme in ('http', 'https') and parse_result.netloc != '
' |
LEFT | RIGHT |