Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2082)

Unified Diff: ppapi/generate_ppapi_size_checks.py

Issue 8653004: Fix python scripts in src/ppapi/ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase error Created 8 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ppapi/generate_ppapi_include_tests.py ('k') | ppapi/generators/generator.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/generate_ppapi_size_checks.py
diff --git a/ppapi/generate_ppapi_size_checks.py b/ppapi/generate_ppapi_size_checks.py
old mode 100644
new mode 100755
index e1ba8a4f3cfa4aa83e14031d6dc37e5e8746646d..fda3a1c309d401e2ee8009840784df831e3f54e2
--- 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) 2011 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:]))
-
« no previous file with comments | « ppapi/generate_ppapi_include_tests.py ('k') | ppapi/generators/generator.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698