MCPcopy Create free account
hub / github.com/OSGeo/PROJ / snake_casify

Function snake_casify

scripts/create_c_api_projections.py:59–71  ·  view source on GitHub ↗
(s)

Source from the content-addressed store, hash-verified

57test_cppfile.write("/* BEGIN: Generated by scripts/create_c_api_projections.py*/\n")
58
59def snake_casify(s):
60 out = ''
61 lastWasLowerAlpha = False
62 for c in s:
63 if c.isupper():
64 if lastWasLowerAlpha:
65 out += '_'
66 out += c.lower()
67 lastWasLowerAlpha = False
68 else:
69 out += c
70 lastWasLowerAlpha = c.isalpha()
71 return out
72
73
74for sectiondef in compounddef.iter('sectiondef'):

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected