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

Unified Diff: tools/polymer/polymer_grdp_to_txt.py

Issue 2925993002: Polymer: Remove <paper-material> from polymer_resources.grdp file. (Closed)
Patch Set: 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 | « third_party/polymer/v1_0/reproduce.sh ('k') | ui/webui/resources/polymer_resources.grdp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/polymer/polymer_grdp_to_txt.py
diff --git a/tools/polymer/polymer_grdp_to_txt.py b/tools/polymer/polymer_grdp_to_txt.py
index 9940faa36de29f706259df846b0e4e70f34174d0..852a2d3ac59abedee59f4cac92a743b0ebcebc43 100755
--- a/tools/polymer/polymer_grdp_to_txt.py
+++ b/tools/polymer/polymer_grdp_to_txt.py
@@ -3,6 +3,8 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
+from itertools import chain
+from os import path as os_path
import sys
import xml.sax
@@ -12,6 +14,19 @@ class PathsExtractor(xml.sax.ContentHandler):
def __init__(self):
self.paths = []
+ # Following elements are not used anymore, but are unfortunately downloaded
michaelpg 2017/06/07 05:44:07 Can you clarify what your purpose is in adding thi
dpapad 2017/06/07 17:19:14 What I had in mind was that if someone runs 1,2,3
dpapad 2017/06/07 20:44:45 Resolved per offline discussion with michaelpg@, b
+ # because they co-reside in the same GitHub repository with elements that
+ # are still used. Adding them in this blacklist will prevent such elements
+ # from being included in the final polymer_resources.grdp file.
+ blacklisted_elements = [
+ 'paper-material'
+ ]
+
+ self.blacklist = list(chain(*map(
+ lambda dep: map(
+ lambda suffix: dep + suffix, ['.html', '-extracted.js']),
+ blacklisted_elements)))
+
def startElement(self, name, attrs):
if name != 'structure':
return
@@ -20,6 +35,8 @@ class PathsExtractor(xml.sax.ContentHandler):
return
prefix_1_0 = '../../../third_party/polymer/v1_0/components-chromium/'
if path.startswith(prefix_1_0):
+ if os_path.basename(path) in self.blacklist:
+ return
self.paths.append(path[len(prefix_1_0):])
else:
raise Exception("Unexpected path %s." % path)
« no previous file with comments | « third_party/polymer/v1_0/reproduce.sh ('k') | ui/webui/resources/polymer_resources.grdp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698