diff options
author | Frank Elias <francois.elias@livio.io> | 2020-08-31 17:02:35 -0400 |
---|---|---|
committer | Frank Elias <francois.elias@livio.io> | 2020-08-31 17:02:35 -0400 |
commit | 5335489796f8d438b8c4e7c60d29bc506c1f9d16 (patch) | |
tree | 9dc8490561c9ca7c578902793f1b67693453f28c | |
parent | 67d931e45e485c0e7dcce457b0d6e3f164e4b7d8 (diff) | |
download | sdl_ios-5335489796f8d438b8c4e7c60d29bc506c1f9d16.tar.gz |
textwrap.wrap is added
-rw-r--r-- | generator/transformers/common_producer.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/generator/transformers/common_producer.py b/generator/transformers/common_producer.py index ecdc892a2..31092853a 100644 --- a/generator/transformers/common_producer.py +++ b/generator/transformers/common_producer.py @@ -156,7 +156,9 @@ class InterfaceProducerCommon(ABC): """ if not data: return [] - return data + if isinstance(data, list): + data = ' '.join(data) + return textwrap.wrap(re.sub(r'(\s{2,}|\n)', ' ', data).strip(), length) @staticmethod def nullable(type_native: str, mandatory: bool) -> str: @@ -335,7 +337,7 @@ class InterfaceProducerCommon(ABC): 'mandatory': param.is_mandatory, 'deprecated': json.loads(param.deprecated.lower()) if param.deprecated else False, 'modifier': 'strong'} - if isinstance(param.param_type, (Integer, Float, String, Array)): + if isinstance(param.param_type, (Integer, Float, String, Array, Boolean)): data['description'].append(self.create_param_descriptor(param.param_type, OrderedDict())) data.update(self.extract_type(param)) |