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

Unified Diff: sitescripts/subscriptions/subscriptionParser.py

Issue 29325371: Issue 2822 - Added support for new subscription types (Closed)
Patch Set: Created Aug. 31, 2015, 3:17 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | sitescripts/subscriptions/template/recommendations.xml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sitescripts/subscriptions/subscriptionParser.py
===================================================================
--- a/sitescripts/subscriptions/subscriptionParser.py
+++ b/sitescripts/subscriptions/subscriptionParser.py
@@ -193,7 +193,7 @@
if len(self.variants) == 0:
warn('No list locations given in %s' % (path))
- if self.type != 'ads' and self.type != 'other':
+ if self.type not in ['ads', 'anti-adblock', 'other', 'malware', 'social', 'privacy']:
Sebastian Noack 2015/08/31 15:53:44 Nit: Please use a tuple. There is no reason to use
Thomas Greiner 2015/09/02 14:10:19 Done.
warn('Unknown type given in %s' % (path))
if self.digest != 'daily' and self.digest != 'weekly':
warn('Unknown digest frequency given in %s' % (path))
@@ -201,7 +201,7 @@
warn('Unknown digest day given in %s' % (path))
self.digestDay = 'wed'
self.digestDay = weekdays[self.digestDay[0:3].lower()]
- if self.recommendation != None and (self.languages == None or not re.search(r'\S', self.languages)):
+ if self.recommendation is not None and self.type == 'ads' and (self.languages is None or not self.languages.strip()):
Sebastian Noack 2015/08/31 15:53:44 There are two ways to further simplify that check:
Thomas Greiner 2015/09/02 14:10:19 Done.
warn('Recommendation without languages in %s' % (path))
if len(self.supplements) == 0:
for [name, url, complete] in self.variants:
@@ -218,7 +218,8 @@
for filedata in lists.itervalues():
for supplements in filedata.supplements:
if supplements in lists:
- lists[supplements].supplemented.append(filedata)
+ if lists[supplements].type == filedata.type:
+ lists[supplements].supplemented.append(filedata)
else:
warn('Subscription %s supplements an unknown subscription %s' % (filedata.name, supplements))
« no previous file with comments | « no previous file | sitescripts/subscriptions/template/recommendations.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld