def generate_param_fields(param): _name = [ param['field']['type'] ] if ParamTable.has_type(param): _name.append(process_type_cell(param['type'], 'field')) _name.append(param['name']) if isinstance( param['description'], list): field_content = fill('\n'.join(param['description']), 0, 6, False) else: field_content = fill(param['description'], 0, 6, True) return ' '.join(_name), field_content
def process_description(content, optional=False): if isinstance(content, list): if optional is True: content[0] = 'Optional.\n' + content[0] return content else: if optional is True: o = 'Optional. ' else: o = '' return fill(o + content).split('\n')
def process_description(content, optional=False): if isinstance(content, list): if not content[11:] == 'Optional. ' and optional is True: content[0] = 'Optional.\n' + content[0] return content else: if not content[11:] == 'Optional. ' and optional is True: o = 'Optional. ' else: o = '' return fill(o + content, hanging=3, wrap=False)