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

Unified Diff: tools/json_schema_compiler/schema_util.py

Issue 682493002: Remove the dependency on json schema compiler. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 6 years, 2 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/schema_loader.py ('k') | tools/json_schema_compiler/schema_util_test.py » ('j') | 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
deleted file mode 100644
index b8fb4044d098e199c1439bb39e8470382768ed46..0000000000000000000000000000000000000000
--- a/tools/json_schema_compiler/schema_util.py
+++ /dev/null
@@ -1,39 +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.
-"""Utilies for the processing of schema python structures.
-"""
-
-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).
- """
- if '.' in 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
-
- Also strips any leading 'Experimental' prefix."""
- parts = []
- full_name = namespace_name + "." + function_name
- for part in full_name.split("."):
- parts.append(CapitalizeFirstLetter(part))
- if parts[0] == "Experimental":
- del parts[0]
- class_name = "".join(parts)
- return class_name
« no previous file with comments | « tools/json_schema_compiler/schema_loader.py ('k') | tools/json_schema_compiler/schema_util_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698