| 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())
|
|
|