mirror of
https://github.com/evennia/evennia.git
synced 2026-03-30 04:27:16 +02:00
Merge branch 'master' into develop
This commit is contained in:
commit
f68ec81c76
1 changed files with 7 additions and 3 deletions
|
|
@ -318,7 +318,7 @@ def fill(text, width=_DEFAULT_WIDTH, **kwargs):
|
|||
# EvCell class (see further down for the EvTable itself)
|
||||
|
||||
|
||||
class EvCell(object):
|
||||
class EvCell:
|
||||
"""
|
||||
Holds a single data cell for the table. A cell has a certain width
|
||||
and height and contains one or more lines of data. It can shrink
|
||||
|
|
@ -986,14 +986,17 @@ class EvColumn(object):
|
|||
Available keywods as per `EvCell.__init__`.
|
||||
|
||||
"""
|
||||
# column-level options override those in kwargs
|
||||
options = {**kwargs, **self.options}
|
||||
|
||||
ypos = kwargs.get("ypos", None)
|
||||
if ypos is None or ypos > len(self.column):
|
||||
# add to the end
|
||||
self.column.extend([EvCell(data, **self.options) for data in args])
|
||||
self.column.extend([EvCell(data, **options) for data in args])
|
||||
else:
|
||||
# insert cells before given index
|
||||
ypos = min(len(self.column) - 1, max(0, int(ypos)))
|
||||
new_cells = [EvCell(data, **self.options) for data in args]
|
||||
new_cells = [EvCell(data, **options) for data in args]
|
||||
self.column = self.column[:ypos] + new_cells + self.column[ypos:]
|
||||
# self._balance(**kwargs)
|
||||
|
||||
|
|
@ -1020,6 +1023,7 @@ class EvColumn(object):
|
|||
Keywords as per `EvCell.__init__`.
|
||||
|
||||
"""
|
||||
# column-level options take precedence here
|
||||
kwargs.update(self.options)
|
||||
self.column[index].reformat(**kwargs)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue