def generate_param_fields(param): _name = [ param['field']['type'] ] if ParamTable.has_type(param): _name.append(process_type_cell(param['type'], 'field')) if param['name'] is not None: _name.append(param['name']) description = param['description'] if isinstance( param['description'], list): field_content = fill('\n'.join(param['description']), 0, 6, False) else: field_content = fill(param['description'], 0, 6, False) return ' '.join(_name), field_content
def generate_param_fields(param): _name = [param['field']['type']] if ParamTable.has_type(param): _name.append(process_type_cell(param['type'], 'field')) if param['name'] is not None: _name.append(param['name']) description = param['description'] if isinstance(param['description'], list): field_content = fill('\n'.join(param['description']), 0, 6, False) else: field_content = fill(param['description'], 0, 6, False) return ' '.join(_name), field_content
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)