mirror of
https://github.com/evennia/evennia.git
synced 2026-03-19 22:36:31 +01:00
Fixed bug that added too many empty rows when adding columns to EvTable using .add_column()
This commit is contained in:
parent
07aba24f4d
commit
2bf3a5ce52
1 changed files with 4 additions and 4 deletions
|
|
@ -704,7 +704,7 @@ class EvColumn(object):
|
|||
of the rest of the column's cells (use update to change
|
||||
options).
|
||||
|
||||
Args:j
|
||||
Args:
|
||||
data for the new cells
|
||||
Keywords:
|
||||
ypos - index position in table before which to insert the
|
||||
|
|
@ -1167,16 +1167,16 @@ class EvTable(object):
|
|||
xpos = kwargs.get("xpos", None)
|
||||
column = EvColumn(*args, **options)
|
||||
htable = self.nrows
|
||||
excess = self.ncols - htable
|
||||
excess = len(column.column) - htable
|
||||
|
||||
if excess > 0:
|
||||
# we need to add new rows to table
|
||||
for col in self.table:
|
||||
empty_rows = ["" for i in range(excess)]
|
||||
empty_rows = ["" for i in xrange(excess)]
|
||||
col.add_rows(*empty_rows, **options)
|
||||
elif excess < 0:
|
||||
# we need to add new rows to new column
|
||||
empty_rows = ["" for i in range(abs(excess))]
|
||||
empty_rows = ["" for i in xrange(abs(excess))]
|
||||
column.add_rows(*empty_rows, **options)
|
||||
|
||||
header = kwargs.get("header", None)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue