Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(809)

Unified Diff: components/cronet/tools/generate_accept_languages.py

Issue 2960673003: [cronet] replace filter with comprehension in build script (Closed)
Patch Set: make more readable Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/cronet/tools/generate_accept_languages.py
diff --git a/components/cronet/tools/generate_accept_languages.py b/components/cronet/tools/generate_accept_languages.py
index f192058d8d14844cede82221ab617e55124ac2a1..066410151d3d758cc0aed4433134384f92f98d25 100644
--- a/components/cronet/tools/generate_accept_languages.py
+++ b/components/cronet/tools/generate_accept_languages.py
@@ -25,9 +25,11 @@ def extract_accept_langs(filename):
return tree.get('lang'), child.text
def gen_accept_langs_table():
- return dict(filter(None, (extract_accept_langs(filename)
+ accept_langs_dict = (extract_accept_langs(filename)
lilyhoughton 2017/06/28 14:24:04 How is this?
xunjieli 2017/06/28 14:53:52 Shouldn't Python list comprehension use square bra
for filename in os.listdir(STRINGS_DIR)
- if re.match(r'components_locale_settings_\S+.xtb', filename))))
+ if re.match(r'components_locale_settings_\S+.xtb', filename))
+ return dict(accept_langs for accept_langs in accept_langs_dict
+ if accept_langs)
HEADER = "NSDictionary* acceptLangs = @{"
def LINE(locale, accept_langs):
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698