def _transform_outputs()

in rostran/providers/ros/template.py [0:0]


    def _transform_outputs(self) -> List[tf.Output]:
        tf_outputs = []
        for name, value in self.outputs.items():
            tf_name = camel_to_snake(name)
            tf_value = dict()

            resolved_value = self.resolve_values(value.get("Value"))
            condition = value.get("Condition")
            if condition:
                cont_value = f"local.{condition} ? {resolved_value} : {tf.NullType()}"
                tf_value["value"] = tf.LiteralType(cont_value)
            else:
                if isinstance(resolved_value, tf.CommentType):
                    tf_value["value_comment"] = resolved_value
                    tf_value["value"] = tf.NullType()
                else:
                    tf_value["value"] = resolved_value
            desc = value.get("Description")
            if desc:
                if isinstance(desc, str) and "\n" not in desc:
                    tf_value["description"] = tf.QuotedString(desc)
                else:
                    desc = json.dumps(desc, indent=2, ensure_ascii=False)
                    desc = textwrap.indent(desc, "  ")
                    tf_value["description"] = f"<<EOT\n{desc}\n  EOT"

            output_block = tf.Output(tf_name, tf_value)
            tf_outputs.append(output_block)
        return tf_outputs