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

Side by Side Diff: tools/json_schema_compiler/cpp_util.py

Issue 23549025: Clean up JSON Schema Compiler. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: 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 unified diff | Download patch
OLDNEW
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 """Utilies and constants specific to Chromium C++ code. 5 """Utilies and constants specific to Chromium C++ code.
6 """ 6 """
7 7
8 from code import Code 8 from code import Code
9 from datetime import datetime 9 from datetime import datetime
10 from model import Property, PropertyType, Type 10 from model import PropertyType
11 import os 11 import os
12 import re 12 import re
13 13
14 CHROMIUM_LICENSE = ( 14 CHROMIUM_LICENSE = (
15 """// Copyright (c) %d The Chromium Authors. All rights reserved. 15 """// Copyright (c) %d The Chromium Authors. All rights reserved.
16 // Use of this source code is governed by a BSD-style license that can be 16 // Use of this source code is governed by a BSD-style license that can be
17 // found in the LICENSE file.""" % datetime.now().year 17 // found in the LICENSE file.""" % datetime.now().year
18 ) 18 )
19 GENERATED_FILE_MESSAGE = """// GENERATED FROM THE API DEFINITION IN 19 GENERATED_FILE_MESSAGE = """// GENERATED FROM THE API DEFINITION IN
20 // %s 20 // %s
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 c.Append('namespace %s {' % component) 104 c.Append('namespace %s {' % component)
105 return c 105 return c
106 106
107 def CloseNamespace(namespace): 107 def CloseNamespace(namespace):
108 """Get closing root namespace declarations. 108 """Get closing root namespace declarations.
109 """ 109 """
110 c = Code() 110 c = Code()
111 for component in reversed(namespace.split('::')): 111 for component in reversed(namespace.split('::')):
112 c.Append('} // namespace %s' % component) 112 c.Append('} // namespace %s' % component)
113 return c 113 return c
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698