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 Sept. 2, 2015, 2:07 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'):
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 not (self.languages and self.languages.strip()):
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