Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Delta Between Two Patch Sets: sitescripts/subscriptions/subscriptionParser.py

Issue 29811558: Issue 6754 - Support the "circumvention" type (Closed) Base URL: https://hg.adblockplus.org/sitescripts/
Left Patch Set: Created June 20, 2018, 12:19 p.m.
Right Patch Set: PEP-8 conformance Created June 20, 2018, 1:19 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « no previous file | no next file » | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
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
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',
tlucas 2018/06/20 13:02:37 Nit: While adding or changing lines, please adhere
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
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 != ' '
LEFTRIGHT
« no previous file | no next file » | Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Toggle Comments ('s')

Powered by Google App Engine
This is Rietveld