aboutsummaryrefslogtreecommitdiffstats
path: root/build-aux/qmi-codegen/Message.py
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@lanedo.com>2012-09-18 18:51:53 +0200
committerAleksander Morgado <aleksander@lanedo.com>2012-09-18 18:51:53 +0200
commit8a90c928a7d92355e6a738cb2844ce37253afc9a (patch)
treed37b232234d4d91d21c2798d84773d5bae5f426c /build-aux/qmi-codegen/Message.py
parenta2844ab0414b51e0e4abfda22d79912345e48d08 (diff)
downloadexternal_libqmi-8a90c928a7d92355e6a738cb2844ce37253afc9a.zip
external_libqmi-8a90c928a7d92355e6a738cb2844ce37253afc9a.tar.gz
external_libqmi-8a90c928a7d92355e6a738cb2844ce37253afc9a.tar.bz2
qmi-codegen: fix printable indications
Diffstat (limited to 'build-aux/qmi-codegen/Message.py')
-rw-r--r--build-aux/qmi-codegen/Message.py53
1 files changed, 29 insertions, 24 deletions
diff --git a/build-aux/qmi-codegen/Message.py b/build-aux/qmi-codegen/Message.py
index b5cf809..016c416 100644
--- a/build-aux/qmi-codegen/Message.py
+++ b/build-aux/qmi-codegen/Message.py
@@ -286,31 +286,36 @@ class Message:
'{\n'
' const gchar *tlv_type_str = NULL;\n'
' gchar *translated_value;\n'
- '\n'
- ' if (!qmi_message_is_response (ctx->self)) {\n'
- ' switch (type) {\n')
-
- if self.input is not None and self.input.fields is not None:
- for field in self.input.fields:
- translations['underscore_field'] = utils.build_underscore_name(field.fullname)
- translations['field_enum'] = field.id_enum_name
- translations['field_name'] = field.name
- field_template = (
- ' case ${field_enum}:\n'
- ' tlv_type_str = "${field_name}";\n'
- ' translated_value = ${underscore_field}_get_printable (\n'
- ' ctx->self,\n'
- ' ctx->line_prefix);\n'
- ' break;\n')
- template += string.Template(field_template).substitute(translations)
-
- template += (
- ' default:\n'
- ' break;\n'
- ' }\n'
- ' } else {\n'
- ' switch (type) {\n')
+ '\n')
+
+ if self.type == 'Message':
+ template += (
+ ' if (!qmi_message_is_response (ctx->self)) {\n'
+ ' switch (type) {\n')
+
+ if self.input is not None and self.input.fields is not None:
+ for field in self.input.fields:
+ translations['underscore_field'] = utils.build_underscore_name(field.fullname)
+ translations['field_enum'] = field.id_enum_name
+ translations['field_name'] = field.name
+ field_template = (
+ ' case ${field_enum}:\n'
+ ' tlv_type_str = "${field_name}";\n'
+ ' translated_value = ${underscore_field}_get_printable (\n'
+ ' ctx->self,\n'
+ ' ctx->line_prefix);\n'
+ ' break;\n')
+ template += string.Template(field_template).substitute(translations)
+
+ template += (
+ ' default:\n'
+ ' break;\n'
+ ' }\n'
+ ' } else {\n')
+ else:
+ template += (' {\n')
+ template += (' switch (type) {\n')
if self.output is not None and self.output.fields is not None:
for field in self.output.fields:
translations['underscore_field'] = utils.build_underscore_name(field.fullname)