-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Description
ANSITable.addcolumn() does this:
Line 551 in 1fd2e99
| 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:
Lines 520 to 522 in 1fd2e99
| 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?
Metadata
Metadata
Assignees
Labels
No labels