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

Unified Diff: sitescripts/notifications/parser.py

Issue 29344600: Noissue - Got rid of E129, E704, E712, E731 and F821 errors (Closed)
Patch Set: Created May 26, 2016, 12:49 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 | « sitescripts/extensions/bin/updateUpdateManifests.py ('k') | sitescripts/reports/utils.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sitescripts/notifications/parser.py
===================================================================
--- a/sitescripts/notifications/parser.py
+++ b/sitescripts/notifications/parser.py
@@ -96,11 +96,13 @@
raise Exception("Unknown parameter '%s' in file '%s'" % (key, name))
for text_key in ("title", "message"):
- def has_default_locale(variant): return "en-US" in variant[text_key]
- if (not has_default_locale(notification) and
- not all(map(has_default_locale, notification.get("variants", [])))):
- raise Exception("No %s for en-US (default language) in file '%s'" %
- (text_key, name))
+ def has_default_locale(variant):
+ return "en-US" in variant[text_key]
+ if not has_default_locale(notification):
+ variants = notification.get("variants", [])
+ if not all(map(has_default_locale, variants)):
+ raise Exception("No %s for en-US (default language) "
+ "in file '%s'" % (text_key, name))
return notification
« no previous file with comments | « sitescripts/extensions/bin/updateUpdateManifests.py ('k') | sitescripts/reports/utils.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld