diff options
author | Aleksander Morgado <aleksander@lanedo.com> | 2013-05-21 17:21:50 +0200 |
---|---|---|
committer | Aleksander Morgado <aleksander@lanedo.com> | 2013-05-21 17:34:07 +0200 |
commit | dafaa83761a9514bccfe64c9fc2c3ff7ceeb23cf (patch) | |
tree | 5af436d1ec3ec4f5ba2899af2c7603471d92e01c /build-aux/mbim-codegen | |
parent | e237b5e2b499a25fc7a11ee7a1fc3877cf4cd6c4 (diff) | |
download | libmbim-dafaa83761a9514bccfe64c9fc2c3ff7ceeb23cf.tar.gz |
docs: setup sections for commands
Diffstat (limited to 'build-aux/mbim-codegen')
-rw-r--r-- | build-aux/mbim-codegen/Message.py | 32 | ||||
-rw-r--r-- | build-aux/mbim-codegen/ObjectList.py | 18 | ||||
-rw-r--r-- | build-aux/mbim-codegen/Struct.py | 2 |
3 files changed, 39 insertions, 13 deletions
diff --git a/build-aux/mbim-codegen/Message.py b/build-aux/mbim-codegen/Message.py index 4adea86..c345e5d 100644 --- a/build-aux/mbim-codegen/Message.py +++ b/build-aux/mbim-codegen/Message.py @@ -658,7 +658,33 @@ class Message: """ - Emit the sections + Emit the section content """ - def emit_sections(self, sfile): - pass + def emit_section_content(self, sfile): + translations = { 'name_dashed' : utils.build_dashed_name(self.name), + 'underscore' : utils.build_underscore_name(self.fullname) } + + template = ( + '\n' + '<SUBSECTION ${name_dashed}>\n') + sfile.write(string.Template(template).substitute(translations)) + + if self.has_query: + template = ( + '${underscore}_query_new\n') + sfile.write(string.Template(template).substitute(translations)) + + if self.has_set: + template = ( + '${underscore}_set_new\n') + sfile.write(string.Template(template).substitute(translations)) + + if self.has_response: + template = ( + '${underscore}_response_parse\n') + sfile.write(string.Template(template).substitute(translations)) + + if self.has_notification: + template = ( + '${underscore}_notification_parse\n') + sfile.write(string.Template(template).substitute(translations)) diff --git a/build-aux/mbim-codegen/ObjectList.py b/build-aux/mbim-codegen/ObjectList.py index 6e4899b..ddb5a68 100644 --- a/build-aux/mbim-codegen/ObjectList.py +++ b/build-aux/mbim-codegen/ObjectList.py @@ -95,21 +95,21 @@ class ObjectList: translations = { 'service_dashed' : utils.build_dashed_name(self.service), 'service' : self.service } - # Emit the section with all the types for the service + # Emit section header template = ( '\n' '<SECTION>\n' - '<FILE>mbim-${service_dashed}-types</FILE>\n' - '<TITLE>${service} data types</TITLE>\n') + '<FILE>mbim-${service_dashed}</FILE>\n' + '<TITLE>${service}</TITLE>\n') sfile.write(string.Template(template).substitute(translations)) + # Emit subsection per type for struct in self.struct_list: struct.emit_section_content(sfile) - template = ( - '</SECTION>\n') - sfile.write(template) + # Emit subsection per command + for command in self.command_list: + command.emit_section_content(sfile) - # Emit per-command sections - for item in self.command_list: - item.emit_sections(sfile) + sfile.write( + '</SECTION>\n') diff --git a/build-aux/mbim-codegen/Struct.py b/build-aux/mbim-codegen/Struct.py index 3ea037d..325676f 100644 --- a/build-aux/mbim-codegen/Struct.py +++ b/build-aux/mbim-codegen/Struct.py @@ -247,7 +247,7 @@ class Struct: '\n' '/**\n' ' * ${name_underscore}_array_free:\n' - ' * @array: a #NULL-terminated array of #${name} structs.\n' + ' * @array: a #NULL terminated array of #${name} structs.\n' ' *\n' ' * Frees the memory allocated for the array of #${name}s.\n' ' */\n' |