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

Unified Diff: tools/json_schema_compiler/schema_util.py

Issue 23549025: Clean up JSON Schema Compiler. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Removed enum test and added blank lines. Created 7 years, 3 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 | « tools/json_schema_compiler/preview.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/schema_util.py
diff --git a/tools/json_schema_compiler/schema_util.py b/tools/json_schema_compiler/schema_util.py
index 7ce399e8ed31e0a0a75a76d82176a39a9a00e6a1..b8fb4044d098e199c1439bb39e8470382768ed46 100644
--- a/tools/json_schema_compiler/schema_util.py
+++ b/tools/json_schema_compiler/schema_util.py
@@ -4,17 +4,18 @@
"""Utilies for the processing of schema python structures.
"""
-import json_parse
-
def CapitalizeFirstLetter(value):
return value[0].capitalize() + value[1:]
+
def GetNamespace(ref):
return SplitNamespace(ref)[0]
+
def StripNamespace(ref):
return SplitNamespace(ref)[1]
+
def SplitNamespace(ref):
"""Returns (namespace, entity) from |ref|, e.g. app.window.AppWindow ->
(app.window, AppWindow). If |ref| isn't qualified then returns (None, ref).
@@ -23,6 +24,7 @@ def SplitNamespace(ref):
return tuple(ref.rsplit('.', 1))
return (None, ref)
+
def JsFunctionNameToClassName(namespace_name, function_name):
"""Transform a fully qualified function name like foo.bar.baz into FooBarBaz
« no previous file with comments | « tools/json_schema_compiler/preview.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698