OLD | NEW |
1 # Copyright (c) 2012 Google Inc. All rights reserved. | 1 # Copyright (c) 2012 Google Inc. 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 os | 5 import os |
6 import re | 6 import re |
7 import shutil | 7 import shutil |
8 | 8 |
9 prefixes = ["../third_party/WebKit/Source/WebCore/platform/graphics/chromium", | 9 prefixes = ["../third_party/WebKit/Source/WebCore/platform/graphics/chromium", |
10 "../third_party/WebKit/Source/WebCore/platform/graphics/chromium/cc"
, | 10 "../third_party/WebKit/Source/WebCore/platform/graphics/chromium/cc"
, |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 | 54 |
55 fixed_text = FixCopyrightHeaderText(text, year) | 55 fixed_text = FixCopyrightHeaderText(text, year) |
56 with open(filepath, "w") as f: | 56 with open(filepath, "w") as f: |
57 f.write(fixed_text) | 57 f.write(fixed_text) |
58 | 58 |
59 def Readfile(gypfile): | 59 def Readfile(gypfile): |
60 with open(gypfile, "r") as cc_gyp: | 60 with open(gypfile, "r") as cc_gyp: |
61 obj = eval(cc_gyp.read()) | 61 obj = eval(cc_gyp.read()) |
62 return obj | 62 return obj |
63 | 63 |
64 def Main(): | 64 def CopyFiles(files): |
65 files = Readfile("cc.gyp")['variables']['cc_source_files'] | |
66 for f in files: | 65 for f in files: |
67 dst = Copy(f) | 66 dst = Copy(f) |
68 FixCopyrightHeader(dst) | 67 FixCopyrightHeader(dst) |
69 | 68 |
70 files = Readfile("cc_tests.gyp")['variables']['cc_tests_source_files'] | 69 def Main(): |
71 for f in files: | 70 CopyFiles(Readfile("cc.gyp")['variables']['cc_source_files']) |
72 dst = Copy(f) | 71 CopyFiles(Readfile("cc_tests.gyp")['variables']['cc_tests_source_files']) |
73 FixCopyrightHeader(dst) | 72 CopyFiles(Readfile("cc_tests.gyp")['variables']['cc_tests_support_files']) |
74 | 73 |
75 if __name__ == '__main__': | 74 if __name__ == '__main__': |
76 import sys | 75 import sys |
77 os.chdir(os.path.dirname(__file__)) | 76 os.chdir(os.path.dirname(__file__)) |
78 sys.exit(Main()) | 77 sys.exit(Main()) |
OLD | NEW |