Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def header(self, value):
self._header = BTColumnHeader(self._table, value)
def __setitem__(self, key, value):
self._validate_item(value)
super(BTColumnHeader, self).__setitem__(key, value)
def _reset_state(self, ncol):
self._table._ncol = ncol
self._header = BTColumnHeader(self._table, [None] * ncol)
self._auto_width = True
self._alignment = AlignmentMetaData(
self._table, [self.default_alignment] * ncol
)
self._width = NonNegativeIntegerMetaData(self._table, [0] * ncol)
self._padding_left = NonNegativeIntegerMetaData(
self._table, [self.default_padding] * ncol
)
self._padding_right = NonNegativeIntegerMetaData(
self._table, [self.default_padding] * ncol
)
self._table._data = type(self._table._data)(
self._table,
[
BTRowData(self._table, [None] * ncol)
for i in range(len(self._table._data))
BTColumnHeader.__getitem__,
details="Use 'BeautifulTable.columns.header.index(header)' instead.",
)
def get_column_index(self, header): # pragma: no cover
return self.columns.header.index(header)