summaryrefslogtreecommitdiff
path: root/build-aux
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@lanedo.com>2013-04-16 18:42:02 +0200
committerAleksander Morgado <aleksander@lanedo.com>2013-04-21 19:28:17 +0200
commitd639ad7654bed7a9fec1eb6d1f01fa327f3ec10d (patch)
treeced7055ad7397abc9e5f6c050b510a69ed97552b /build-aux
parentf5e612b72297fcf40f5efe268c41ea73e9fc96ad (diff)
mbim-codegen: don't treat 'IP' as a CamelCase substring
Diffstat (limited to 'build-aux')
-rw-r--r--build-aux/mbim-codegen/utils.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/build-aux/mbim-codegen/utils.py b/build-aux/mbim-codegen/utils.py
index ddcf92f..7666a1d 100644
--- a/build-aux/mbim-codegen/utils.py
+++ b/build-aux/mbim-codegen/utils.py
@@ -144,7 +144,8 @@ Build an underscore name from the given camelcase name
e.g.: "ThisIsAMessage" --> "this_is_a_message"
"""
def build_underscore_name_from_camelcase(camelcase):
- s1 = re.sub('(.)([A-Z][a-z]+)', r'\1_\2', camelcase)
+ s0 = camelcase.replace('IP','Ip')
+ s1 = re.sub('(.)([A-Z][a-z]+)', r'\1_\2', s0)
return re.sub('([a-z0-9])([A-Z])', r'\1_\2', s1).lower()