We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 614539a commit de40a8bCopy full SHA for de40a8b
1 file changed
src/mako/lib/util.py
@@ -244,11 +244,15 @@ def extract_parts(desc):
244
# ------------------------------------------------------------------------------
245
## @{
246
247
+def capitalize(s):
248
+ return s[:1].upper() + s[1:]
249
+
250
# Return transformed string that could make a good type name
251
def canonical_type_name(s):
252
# can't use s.capitalize() as it will lower-case the remainder of the string
- s = s.replace(' ', '')
- return s[:1].upper() + s[1:]
253
+ s = ''.join(capitalize(t) for t in s.split(' '))
254
+ s = ''.join(capitalize(t) for t in s.split('_'))
255
+ return capitalize(s)
256
257
def nested_type_name(sn, pn):
258
return sn + canonical_type_name(pn)
0 commit comments