ANSITable.addcolumn() does this:
|
self.columns.append(Column(name, **kwargs)) |
But it doesn't do the additional step found in the ANSITable's __init__ method of assigning self to c.table:
|
c = Column(c) |
|
c.table = self |
|
self.columns.append(c) |
Due to that, I'm getting an error like this:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "...\Lib\site-packages\ansitable\table.py", line 828, in print
print(str(self), file=file)
^^^^^^^^^
File "...\Lib\site-packages\ansitable\table.py", line 865, in __str__ text += self._row() # add the headers
^^^^^^^^^^^
File "...\Lib\site-packages\ansitable\table.py", line 782, in _row
text += c._formatcolumn(
^^^^^^^^^^^^^^^^
File "...\Lib\site-packages\ansitable\table.py", line 248, in _formatcolumn
gap1 = _spaces(gap + self.table.colsep)
^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'colsep'
from ansitable import ANSITable
table = ANSITable()
table.addcolumn("")
table.row("a")
table.print()
ansitable 0.11.4
Maybe I'm not using it as it was expected to be used?
ANSITable.addcolumn()does this:ansitable/ansitable/table.py
Line 551 in 1fd2e99
But it doesn't do the additional step found in the ANSITable's
__init__method of assigningselftoc.table:ansitable/ansitable/table.py
Lines 520 to 522 in 1fd2e99
Due to that, I'm getting an error like this:
ansitable 0.11.4
Maybe I'm not using it as it was expected to be used?