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