Chromium Code Reviews| Index: tools/json_schema_compiler/cpp_util.py |
| =================================================================== |
| --- tools/json_schema_compiler/cpp_util.py (revision 179687) |
| +++ tools/json_schema_compiler/cpp_util.py (working copy) |
| @@ -8,6 +8,7 @@ |
| from datetime import datetime |
| from model import Property, PropertyType, Type |
| import os |
| +import re |
| CHROMIUM_LICENSE = ( |
| """// Copyright (c) %d The Chromium Authors. All rights reserved. |
| @@ -30,7 +31,8 @@ |
| eg experimental.downloads -> Experimental_Downloads |
| updateAll -> UpdateAll. |
| """ |
| - return '_'.join([x[0].upper() + x[1:] for x in s.split('.')]) |
| + new_s = re.sub(r'[^a-zA-Z0-9]', '.',s) |
|
Yoyo Zhou
2013/02/01 19:57:18
If we're going to go the regex route, we should go
SanjoyPal
2013/02/05 21:45:33
Done.
|
| + return '_'.join([x[0].upper() + x[1:] for x in new_s.split('.')]) |
|
not at google - send to devlin
2013/02/01 19:59:02
why this change anyway?
SanjoyPal
2013/02/01 20:16:29
http://code.google.com/searchframe#OAMlx_jo-ck/src
|
| def GetAsFundamentalValue(type_, src, dst): |
| """Returns the C++ code for retrieving a fundamental type from a |