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

Unified Diff: sitescripts/management/bin/generateNotifications.py

Issue 6582297721569280: Issue 2275 - Parse notification groups (Closed)
Patch Set: Created April 11, 2015, 9:27 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/notifications/parser.py » ('j') | sitescripts/notifications/parser.py » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sitescripts/management/bin/generateNotifications.py
===================================================================
--- a/sitescripts/management/bin/generateNotifications.py
+++ b/sitescripts/management/bin/generateNotifications.py
@@ -23,6 +23,11 @@
def generate_notifications(path):
notifications = load_notifications()
+ # Ignoring notifications with variants here - we can only process those in a
+ # URL handler.
+ notifications["notifications"] = \
+ filter(lambda notification: not "variants" in notification,
Sebastian Noack 2015/04/13 09:04:37 1. list comprehension > callback 2. |x not in y| >
Felix Dahlke 2015/04/15 08:53:43 Done.
+ notifications["notifications"])
with codecs.open(path, "wb", encoding="utf-8") as file:
json.dump(notifications, file, ensure_ascii=False, indent=2,
separators=(',', ': '), sort_keys=True)
« no previous file with comments | « no previous file | sitescripts/notifications/parser.py » ('j') | sitescripts/notifications/parser.py » ('J')

Powered by Google App Engine
This is Rietveld