From 43ff86c77378bf05fc0afc780dbd0c29f7885ecd Mon Sep 17 00:00:00 2001 From: "jamesr@chromium.org" Date: Sat, 5 Jan 2013 02:23:30 +0000 Subject: Remove no-longer-necessary copyfiles.py scripts and stale cc/README More new year's cleanup. These scripts haven't been useful for a long time. BUG= Review URL: https://chromiumcodereview.appspot.com/11779006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@175266 0039d316-1c4b-4281-b951-d872f2087c98 --- webkit/compositor_bindings/copyfiles.py | 78 --------------------------------- 1 file changed, 78 deletions(-) delete mode 100644 webkit/compositor_bindings/copyfiles.py (limited to 'webkit') diff --git a/webkit/compositor_bindings/copyfiles.py b/webkit/compositor_bindings/copyfiles.py deleted file mode 100644 index 3d8a4db..0000000 --- a/webkit/compositor_bindings/copyfiles.py +++ /dev/null @@ -1,78 +0,0 @@ -# Copyright (c) 2012 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 shutil -import os -import re - -prefixes = ["../../third_party/WebKit/Source/WebCore/platform/chromium/support", - "../../third_party/WebKit/Source/WebKit/chromium/src", - "../../third_party/WebKit/Source/WebKit/chromium/tests", - "../../third_party/WebKit/Source/WebCore/platform"] - -def Copy(name): - src = name - dst = name - fullsrc = "" - if name.startswith("test/"): - src = src[5:] - for prefix in prefixes: - candidate = "%s/%s" % (prefix, src) - if os.path.exists(candidate): - fullsrc = candidate - break - assert fullsrc != "" - shutil.copyfile(fullsrc, dst) - print "copying from %s to %s" % (fullsrc, dst) - return dst - -def Readfile(gypfile): - cc_gyp = open(gypfile, "r") - obj = eval(cc_gyp.read()) - cc_gyp.close() - return obj - -def FixCopyrightHeaderText(text, year): - header_template = """// Copyright %s 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. -""" - - while text[0].find(" */") == -1: - text = text[1:] - text = text[1:] - - return (header_template % year) + "".join(text) - -def FixCopyrightHeader(filepath): - with open(filepath, "r") as f: - text = f.readlines() - - pattern = ".*Copyright \(C\) (20[01][0-9])" - m = re.match(pattern, text[0]) - if m == None: - m = re.match(pattern, text[1]) - assert m - year = m.group(1) - - fixed_text = FixCopyrightHeaderText(text, year) - with open(filepath, "w") as f: - f.write(fixed_text) - -def Main(): - files = Readfile("compositor_bindings.gyp")['variables']['webkit_compositor_bindings_sources'] - for f in files: - dst = Copy(f) - FixCopyrightHeader(dst) - - variables = Readfile("compositor_bindings_tests.gyp")['variables'] - files = variables['webkit_compositor_bindings_tests_sources'] - for f in files: - dst = Copy(f) - FixCopyrightHeader(dst) - -if __name__ == '__main__': - import sys - os.chdir(os.path.dirname(__file__)) - sys.exit(Main()) -- cgit v1.1