diff options
author | maruel@chromium.org <maruel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-10 17:47:00 +0000 |
---|---|---|
committer | maruel@chromium.org <maruel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-10 17:47:00 +0000 |
commit | 2ec654ac9138785f318b2b23e8a794829ad687d5 (patch) | |
tree | 65fd2dcd8a35464198ee586288c9cf23a67f90a2 /ppapi/generate_ppapi_size_checks.py | |
parent | c8a3935c613f29f8dc9da736fdb58633c13e7246 (diff) | |
download | chromium_src-2ec654ac9138785f318b2b23e8a794829ad687d5.zip chromium_src-2ec654ac9138785f318b2b23e8a794829ad687d5.tar.gz chromium_src-2ec654ac9138785f318b2b23e8a794829ad687d5.tar.bz2 |
Fix python scripts in src/ppapi/
Make sure that:
- shebang is only present for executable files
- shebang is #!/usr/bin/env python
- __main__ is only present for executable files
- file's executable bit is coherent
Also fix EOF LF to be only one.
Minor python style fixes.
TBR=noelallen
BUG=105108
TEST=
Review URL: http://codereview.chromium.org/8653004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@117045 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi/generate_ppapi_size_checks.py')
-rwxr-xr-x[-rw-r--r--] | ppapi/generate_ppapi_size_checks.py | 38 |
1 files changed, 15 insertions, 23 deletions
diff --git a/ppapi/generate_ppapi_size_checks.py b/ppapi/generate_ppapi_size_checks.py index e1ba8a4..11b4d98 100644..100755 --- a/ppapi/generate_ppapi_size_checks.py +++ b/ppapi/generate_ppapi_size_checks.py @@ -1,12 +1,10 @@ -#!/usr/bin/python - -# Copyright (c) 2010 The Chromium Authors. All rights reserved. +#!/usr/bin/env python +# 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. """This script should be run manually on occasion to make sure all PPAPI types have appropriate size checking. - """ import optparse @@ -20,9 +18,19 @@ import sys ARCH_DEPENDENT_STRING = "ArchDependentSize" +COPYRIGHT_STRING_C = ( +"""/* Copyright (c) %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. + * + * This file has compile assertions for the sizes of types that are dependent + * on the architecture for which they are compiled (i.e., 32-bit vs 64-bit). + */ + +""") % datetime.date.today().year -class SourceLocation: +class SourceLocation(object): """A class representing the source location of a definiton.""" def __init__(self, filename="", start_line=-1, end_line=-1): @@ -31,9 +39,7 @@ class SourceLocation: self.end_line = end_line - -class TypeInfo: - +class TypeInfo(object): """A class representing information about a C++ type. It contains the following fields: - kind: The Clang TypeClassName (Record, Enum, Typedef, Union, etc) @@ -80,8 +86,7 @@ class TypeInfo: self.arch_dependent = (arch_dependent_string == ARCH_DEPENDENT_STRING) -class FilePatch: - +class FilePatch(object): """A class representing a set of line-by-line changes to a particular file. None of the changes are applied until Apply is called. All line numbers are counted from 0. @@ -219,18 +224,6 @@ def IsMacroDefinedName(typename): return typename.find("PP_Dummy_Struct_For_") == 0 -COPYRIGHT_STRING_C = \ -"""/* Copyright (c) 2010 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. - * - * This file has compile assertions for the sizes of types that are dependent - * on the architecture for which they are compiled (i.e., 32-bit vs 64-bit). - */ - -""" - - def WriteArchSpecificCode(types, root, filename): """Write a header file that contains a compile-time assertion for the size of each of the given typeinfos, in to a file named filename rooted at root. @@ -429,4 +422,3 @@ def main(argv): if __name__ == '__main__': sys.exit(main(sys.argv[1:])) - |