MCPcopy Index your code
hub / github.com/rawpython/remi / append_from_list

Method append_from_list

remi/gui.py:2945–2968  ·  view source on GitHub ↗

Appends rows created from the data contained in the provided list of tuples of strings. The first tuple of the list can be set as table title. Args: content (list): list of tuples of strings. Each tuple is a row. fill_title (bool): if true, t

(self, content, fill_title=False)

Source from the content-addressed store, hash-verified

2943 return obj
2944
2945 def append_from_list(self, content, fill_title=False):
2946 """
2947 Appends rows created from the data contained in the provided
2948 list of tuples of strings. The first tuple of the list can be
2949 set as table title.
2950
2951 Args:
2952 content (list): list of tuples of strings. Each tuple is a row.
2953 fill_title (bool): if true, the first tuple in the list will
2954 be set as title.
2955 """
2956 row_index = 0
2957 for row in content:
2958 tr = TableRow()
2959 column_index = 0
2960 for item in row:
2961 if row_index == 0 and fill_title:
2962 ti = TableTitle(item)
2963 else:
2964 ti = TableItem(item)
2965 tr.append(ti, str(column_index))
2966 column_index = column_index + 1
2967 self.append(tr, str(row_index))
2968 row_index = row_index + 1
2969
2970 def append(self, value, key=''):
2971 keys = super(Table, self).append(value, key)

Callers 2

new_from_listMethod · 0.80
Define_TreeTableMethod · 0.80

Calls 5

appendMethod · 0.95
appendMethod · 0.95
TableRowClass · 0.85
TableTitleClass · 0.85
TableItemClass · 0.85

Tested by

no test coverage detected