From 9fa838d3e8d51103ac990ed4808274441149e00f Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Tue, 24 Jul 2018 10:17:57 -0600 Subject: [PATCH] Improve type naming --- scripts/templating/matrix_templates/units.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/scripts/templating/matrix_templates/units.py b/scripts/templating/matrix_templates/units.py index 15c987fd..a4f682bb 100644 --- a/scripts/templating/matrix_templates/units.py +++ b/scripts/templating/matrix_templates/units.py @@ -302,7 +302,7 @@ def process_data_type(prop, required=False, enforce_title=True): for i in items: nested = process_data_type(i) tables.extend(nested['tables']) - nested_titles.extend([nested['title']]) + nested_titles.append(nested['title']) prop_title = "[%s]" % (", ".join(nested_titles), ) else: nested = process_data_type(prop["items"]) @@ -523,10 +523,8 @@ class MatrixUnits(Units): items = param.get("items") if items: if isinstance(items, list): - val_type = "[" - for i in items: - val_type += "%s, " % items.get("type") - val_type = val_type[:-2] + "]" + types = ", ".join(i.get("type") for i in items) + val_type = "[%s]" % (types,) else: val_type = "[%s]" % items.get("type")