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

Unified Diff: chrome/browser/resources/rewrite_licenses.py

Issue 2829933003: WebUI: Swap Uglify with Closure Compiler NodeJS version.
Patch Set: Fix ChromeOS Created 3 years, 8 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 | « chrome/browser/resources/PRESUBMIT.py ('k') | chrome/browser/resources/rewrite_licenses_test.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/rewrite_licenses.py
diff --git a/chrome/browser/resources/rewrite_licenses.py b/chrome/browser/resources/rewrite_licenses.py
new file mode 100755
index 0000000000000000000000000000000000000000..029a70e4cff2191eb76c8ed7a1d612323b011185
--- /dev/null
+++ b/chrome/browser/resources/rewrite_licenses.py
@@ -0,0 +1,21 @@
+#!/usr/bin/env python
+# Copyright 2017 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+import re
+import sys
+
+
+def rewrite(input_data):
+ license = "(?:\/\/\s+)?//( Copyright (?:\(c\) )?[0-9]{4} " \
+ "The Chromium Authors. All rights reserved.\n)" \
+ "//( Use of this source code is governed by a BSD-style license that can"\
+ " be\n)" \
+ "//( found in the LICENSE file.\n)"
+ return re.sub(license, r"/**\n * @license\n *\1 *\2 *\3 */\n", input_data)
+
+
+if __name__ == '__main__':
+ with open(sys.argv[1], 'r') as f:
+ print rewrite(f.read())
« no previous file with comments | « chrome/browser/resources/PRESUBMIT.py ('k') | chrome/browser/resources/rewrite_licenses_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698