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

Unified Diff: tools/polymer/txt_to_polymer_grdp.py

Issue 1215543002: Remove Polymer 0.5. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase on license fix Created 5 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
Index: tools/polymer/txt_to_polymer_grdp.py
diff --git a/tools/polymer/txt_to_polymer_grdp.py b/tools/polymer/txt_to_polymer_grdp.py
index 6aeaefb9caf2981f8047255883dabfc59664a348..7ed3e5aa890b518041770a274455d185907eaf05 100755
--- a/tools/polymer/txt_to_polymer_grdp.py
+++ b/tools/polymer/txt_to_polymer_grdp.py
@@ -18,13 +18,6 @@ FILE_TEMPLATE = \
'polymer_grdp_to_txt.py' converts 'polymer_resources.grdp' to a plane list of
used Polymer components. v1.0 elements are marked with 'v1.0 ' prefix:
dzhioev (left Google) 2015/06/26 05:52:41 Records are not prepended by 'v1.0' as far as I ca
michaelpg 2015/06/26 07:36:46 Done.
...
- core-animation/core-animation.html
- core-animation/web-animations.html
- core-collapse/core-collapse-extracted.js
- core-collapse/core-collapse.css
- core-collapse/core-collapse.html
- core-dropdown/core-dropdown-base-extracted.js
- ...
v1.0 iron-iron-iconset/iron-iconset-extracted.js
dzhioev (left Google) 2015/06/26 05:52:41 ditto
michaelpg 2015/06/26 07:36:46 Done.
v1.0 iron-iron-iconset/iron-iconset.html
...
@@ -37,9 +30,6 @@ FILE_TEMPLATE = \
$ txt_to_polymer_grdp.py /tmp/list.txt > polymer_resources.grdp
-->
<grit-part>
- <!-- Polymer 0.5 (TODO: Remove by M45 branch point) -->
-%(v_0_5)s
-
<!-- Polymer 1.0 -->
%(v_1_0)s
<structure name="IDR_POLYMER_1_0_WEB_ANIMATIONS_JS_WEB_ANIMATIONS_NEXT_LITE_MIN_JS"
@@ -49,43 +39,32 @@ FILE_TEMPLATE = \
"""
-DEFINITION_TEMPLATE_0_5 = \
-""" <structure name="%s"
- file="../../../third_party/polymer/components-chromium/%s"
- type="chrome_html" />"""
-
DEFINITION_TEMPLATE_1_0 = \
""" <structure name="%s"
file="../../../third_party/polymer/v1_0/components-chromium/%s"
type="chrome_html" />"""
-def PathToGritId(path, is_1_0):
+def PathToGritId(path):
table = string.maketrans(string.lowercase + '/.-', string.uppercase + '___')
- return 'IDR_POLYMER_' + ('1_0_' if is_1_0 else '') + path.translate(table)
+ return 'IDR_POLYMER_1_0_' + path.translate(table)
def SortKey(record):
- return (record[1], PathToGritId(record[0], record[1]))
+ return (record, PathToGritId(record))
def ParseRecord(record):
- record = record.strip()
- v_1_0_prefix = 'v1.0 '
- if record.startswith(v_1_0_prefix):
- return (record[len(v_1_0_prefix):], True)
- else:
- return (record, False)
+ return record.strip()
def main(argv):
with open(argv[1]) as f:
records = [ParseRecord(r) for r in f if not r.isspace()]
- lines = { 'v_0_5': [], 'v_1_0': [] }
- for (path, is_1_0) in sorted(set(records), key=SortKey):
- template = DEFINITION_TEMPLATE_1_0 if is_1_0 else DEFINITION_TEMPLATE_0_5
- lines['v_1_0' if is_1_0 else 'v_0_5'].append(
- template % (PathToGritId(path, is_1_0), path))
- print FILE_TEMPLATE % { 'v_0_5': '\n'.join(lines['v_0_5']),
- 'v_1_0': '\n'.join(lines['v_1_0']) }
+ lines = { 'v_1_0': [] }
+ for path in sorted(set(records), key=SortKey):
+ template = DEFINITION_TEMPLATE_1_0
+ lines['v_1_0'].append(
+ template % (PathToGritId(path), path))
+ print FILE_TEMPLATE % { 'v_1_0': '\n'.join(lines['v_1_0']) }
if __name__ == '__main__':
sys.exit(main(sys.argv))

Powered by Google App Engine
This is Rietveld 408576698