tool/btstack_parser: fix camel case output

This commit is contained in:
Matthias Ringwald 2018-11-28 11:28:08 +01:00
parent 2530362585
commit 9c80623268

View File

@ -103,7 +103,7 @@ def parse_events():
return (events, subvents, event_types) return (events, subvents, event_types)
def my_parse_commands(infile, camel_case): def my_parse_commands(infile, convert_to_camel_case):
commands = [] commands = []
with open (infile, 'rt') as fin: with open (infile, 'rt') as fin:
@ -113,7 +113,7 @@ def my_parse_commands(infile, camel_case):
parts = re.match('.*@param\s*(\w*)\s*', line) parts = re.match('.*@param\s*(\w*)\s*', line)
if parts and len(parts.groups()) == 1: if parts and len(parts.groups()) == 1:
param = parts.groups()[0] param = parts.groups()[0]
if camel_case: if convert_to_camel_case:
param = camel_case_var(param) param = camel_case_var(param)
else: else:
param = param.lower() param = param.lower()
@ -126,7 +126,7 @@ def my_parse_commands(infile, camel_case):
# drop _cmd suffix for daemon commands # drop _cmd suffix for daemon commands
if command_name.endswith('_cmd'): if command_name.endswith('_cmd'):
command_name = command_name[:-len('_cmd')] command_name = command_name[:-len('_cmd')]
if camel_case: if convert_to_camel_case:
command_name = camel_case(command_name) command_name = camel_case(command_name)
else: else:
command_name = command_name.lower() command_name = command_name.lower()