Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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))
],
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))
],
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))
],
def width(self, value):
if isinstance(value, str):
if value == "auto":
self._auto_width = True
return
raise ValueError("Invalid value '{}'".format(value))
if isinstance(value, int):
value = [value] * len(self)
self._width = NonNegativeIntegerMetaData(self._table, value)
self._auto_width = False
def padding_right(self, value):
if isinstance(value, int):
value = [value] * len(self)
self._padding_right = NonNegativeIntegerMetaData(self._table, value)