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) |
| + return '_'.join([x[0].upper() + x[1:] for x in re.split('\.', new_s)]) |
|
Yoyo Zhou
2013/02/05 23:42:13
No, the point of using re.split is that you don't
SanjoyPal
2013/02/06 00:47:21
Done.
|
| def GetAsFundamentalValue(type_, src, dst): |
| """Returns the C++ code for retrieving a fundamental type from a |