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

Side by Side Diff: chrome/browser/resources/rewrite_licenses.py

Issue 2829933003: WebUI: Swap Uglify with Closure Compiler NodeJS version.
Patch Set: Fix ChromeOS Created 3 years, 7 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 unified diff | Download patch
OLDNEW
(Empty)
1 #!/usr/bin/env python
2 # Copyright 2017 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file.
5
6 import re
7 import sys
8
9
10 def rewrite(input_data):
11 license = "(?:\/\/\s+)?//( Copyright (?:\(c\) )?[0-9]{4} " \
12 "The Chromium Authors. All rights reserved.\n)" \
13 "//( Use of this source code is governed by a BSD-style license that can"\
14 " be\n)" \
15 "//( found in the LICENSE file.\n)"
16 return re.sub(license, r"/**\n * @license\n *\1 *\2 *\3 */\n", input_data)
17
18
19 if __name__ == '__main__':
20 with open(sys.argv[1], 'r') as f:
21 print rewrite(f.read())
OLDNEW
« 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