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)) |