OLD | NEW |
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 import shutil | 5 import shutil |
6 import os | 6 import os |
7 import re | 7 import re |
8 | 8 |
9 prefixes = ["../../third_party/WebKit/Source/WebCore/platform/chromium/support", | 9 prefixes = ["../../third_party/WebKit/Source/WebCore/platform/chromium/support", |
10 "../../third_party/WebKit/Source/WebKit/chromium/src", | 10 "../../third_party/WebKit/Source/WebKit/chromium/src", |
| 11 "../../third_party/WebKit/Source/WebKit/chromium/tests", |
11 "../../third_party/WebKit/Source/WebCore/platform"] | 12 "../../third_party/WebKit/Source/WebCore/platform"] |
12 | 13 |
13 def Copy(name): | 14 def Copy(name): |
14 src = name | 15 src = name |
15 dst = name | 16 dst = name |
16 fullsrc = "" | 17 fullsrc = "" |
17 for prefix in prefixes: | 18 for prefix in prefixes: |
18 candidate = "%s/%s" % (prefix, src) | 19 candidate = "%s/%s" % (prefix, src) |
19 if os.path.exists(candidate): | 20 if os.path.exists(candidate): |
20 fullsrc = candidate | 21 fullsrc = candidate |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 assert m | 54 assert m |
54 year = m.group(1) | 55 year = m.group(1) |
55 | 56 |
56 fixed_text = FixCopyrightHeaderText(text, year) | 57 fixed_text = FixCopyrightHeaderText(text, year) |
57 with open(filepath, "w") as f: | 58 with open(filepath, "w") as f: |
58 f.write(fixed_text) | 59 f.write(fixed_text) |
59 | 60 |
60 def Main(): | 61 def Main(): |
61 files = Readfile("compositor.gyp")['variables']['webkit_compositor_sources'] | 62 files = Readfile("compositor.gyp")['variables']['webkit_compositor_sources'] |
62 for f in files: | 63 for f in files: |
63 dst =Copy(f) | 64 dst = Copy(f) |
| 65 FixCopyrightHeader(dst) |
| 66 |
| 67 files = Readfile("compositor.gyp")['variables']['webkit_compositor_tests_sourc
es'] |
| 68 for f in files: |
| 69 dst = Copy(f) |
64 FixCopyrightHeader(dst) | 70 FixCopyrightHeader(dst) |
65 | 71 |
66 if __name__ == '__main__': | 72 if __name__ == '__main__': |
67 import sys | 73 import sys |
68 os.chdir(os.path.dirname(__file__)) | 74 os.chdir(os.path.dirname(__file__)) |
69 sys.exit(Main()) | 75 sys.exit(Main()) |
OLD | NEW |