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

Unified Diff: tools/json_schema_compiler/model.py

Issue 10829348: Extensions Docs Server: Large performance increase (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 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 | « chrome/common/extensions/docs/server2/template_data_source_test.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/json_schema_compiler/model.py
diff --git a/tools/json_schema_compiler/model.py b/tools/json_schema_compiler/model.py
index 76b27b20556e2009feb65bf822dc726391bd378b..0c18c91f939f298e28801229e8596150e69c851b 100644
--- a/tools/json_schema_compiler/model.py
+++ b/tools/json_schema_compiler/model.py
@@ -299,31 +299,33 @@ class Property(object):
unix_name = property(GetUnixName, SetUnixName)
+class _PropertyTypeInfo(object):
+ """This class is not an inner class of |PropertyType| so it can be pickled.
+ """
+ def __init__(self, is_fundamental, name):
+ self.is_fundamental = is_fundamental
+ self.name = name
+
+ def __repr__(self):
+ return self.name
+
class PropertyType(object):
"""Enum of different types of properties/parameters.
"""
- class _Info(object):
- def __init__(self, is_fundamental, name):
- self.is_fundamental = is_fundamental
- self.name = name
-
- def __repr__(self):
- return self.name
-
- INTEGER = _Info(True, "INTEGER")
- INT64 = _Info(True, "INT64")
- DOUBLE = _Info(True, "DOUBLE")
- BOOLEAN = _Info(True, "BOOLEAN")
- STRING = _Info(True, "STRING")
- ENUM = _Info(False, "ENUM")
- ARRAY = _Info(False, "ARRAY")
- REF = _Info(False, "REF")
- CHOICES = _Info(False, "CHOICES")
- OBJECT = _Info(False, "OBJECT")
- FUNCTION = _Info(False, "FUNCTION")
- BINARY = _Info(False, "BINARY")
- ANY = _Info(False, "ANY")
- ADDITIONAL_PROPERTIES = _Info(False, "ADDITIONAL_PROPERTIES")
+ INTEGER = _PropertyTypeInfo(True, "INTEGER")
+ INT64 = _PropertyTypeInfo(True, "INT64")
+ DOUBLE = _PropertyTypeInfo(True, "DOUBLE")
+ BOOLEAN = _PropertyTypeInfo(True, "BOOLEAN")
+ STRING = _PropertyTypeInfo(True, "STRING")
+ ENUM = _PropertyTypeInfo(False, "ENUM")
+ ARRAY = _PropertyTypeInfo(False, "ARRAY")
+ REF = _PropertyTypeInfo(False, "REF")
+ CHOICES = _PropertyTypeInfo(False, "CHOICES")
+ OBJECT = _PropertyTypeInfo(False, "OBJECT")
+ FUNCTION = _PropertyTypeInfo(False, "FUNCTION")
+ BINARY = _PropertyTypeInfo(False, "BINARY")
+ ANY = _PropertyTypeInfo(False, "ANY")
+ ADDITIONAL_PROPERTIES = _PropertyTypeInfo(False, "ADDITIONAL_PROPERTIES")
def UnixName(name):
"""Returns the unix_style name for a given lowerCamelCase string.
« no previous file with comments | « chrome/common/extensions/docs/server2/template_data_source_test.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698