Updated evtable docs

This commit is contained in:
Griatch 2015-03-08 22:08:44 +01:00
parent 244c142343
commit f81b756f78
2 changed files with 25 additions and 14 deletions

View file

@ -1,5 +1,6 @@
""" """
This is the basis of the typeclass system. This model defines the basic Object and its children, typeclasses used
for all in-game entities.
The idea is have the object as a normal class with the The idea is have the object as a normal class with the
database-connection tied to itself through a property. database-connection tied to itself through a property.

View file

@ -868,13 +868,13 @@ class EvColumn(object):
Args: Args:
Texts for the new cells Texts for the new cells
Kwargs:
ypos (int, optional): Index position in table before which to insert the ypos (int, optional): Index position in table before which to insert the
new column. Uses Python indexing, so to insert at the top, new column. Uses Python indexing, so to insert at the top,
use `ypos=0`. If not given, data will be inserted at the end use `ypos=0`. If not given, data will be inserted at the end
of the column. of the column.
kwargs (various, optional): Available keywods as per `EvCell.__init__`.
Kwargs:
Available keywods as per `EvCell.__init__`.
""" """
ypos = kwargs.get("ypos", None) ypos = kwargs.get("ypos", None)
@ -1067,7 +1067,7 @@ class EvTable(object):
# balance the table # balance the table
#self._balance() #self._balance()
def _cellborders(self, ix, iy, nx, ny, kwargs): def _cellborders(self, ix, iy, nx, ny, **kwargs):
""" """
Adds borders to the table by adjusting the input kwarg to Adds borders to the table by adjusting the input kwarg to
instruct cells to build a border in the right positions. instruct cells to build a border in the right positions.
@ -1077,7 +1077,9 @@ class EvTable(object):
iy (int): y index positions in table. iy (int): y index positions in table.
nx (int): x size of table. nx (int): x size of table.
ny (int): y size of table. ny (int): y size of table.
kwargs (various, optional): Keywords as per `EvTable.__init__`.
Kwargs:
Keywords as per `EvTable.__init__`.
Returns: Returns:
table (str): string with the correct borders. table (str): string with the correct borders.
@ -1337,8 +1339,11 @@ class EvTable(object):
Args: Args:
args (str): These strings will be used as the header texts. args (str): These strings will be used as the header texts.
kwawrgs (various, optional): Same keywords as per `EvTable.__init__`. Will
be applied to the new header's cells. Kwargs:
Same keywords as per `EvTable.__init__`. Will be applied
to the new header's cells.
""" """
self.header = True self.header = True
self.add_row(ypos=0, *args, **kwargs) self.add_row(ypos=0, *args, **kwargs)
@ -1358,7 +1363,9 @@ class EvTable(object):
xpos (int, optional): Index position in table *before* which xpos (int, optional): Index position in table *before* which
to input new column. If not given, column will be added to the end to input new column. If not given, column will be added to the end
of the table. Uses Python indexing (so first column is `xpos=0`) of the table. Uses Python indexing (so first column is `xpos=0`)
kwargs (various, optional): Same keywords as per `Cell.__init__`.
Kwargs:
Other keywords as per `Cell.__init__`.
""" """
# this will replace default options with new ones without changing default # this will replace default options with new ones without changing default
@ -1414,7 +1421,9 @@ class EvTable(object):
ypos (int, optional): Index position in table before which to ypos (int, optional): Index position in table before which to
input new row. If not given, will be added to the end of the table. input new row. If not given, will be added to the end of the table.
Uses Python indexing (so first row is `ypos=0`) Uses Python indexing (so first row is `ypos=0`)
kwargs (various, optional): Available keywords are as per `EvCell.__init__`.
Kwargs:
Other keywords are as per `EvCell.__init__`.
""" """
# this will replace default options with new ones without changing default # this will replace default options with new ones without changing default
@ -1452,9 +1461,8 @@ class EvTable(object):
""" """
Force a re-shape of the entire table. Force a re-shape of the entire table.
Args: Kwargs:
kwargs (various, optional): Table options as per Table options as per `EvTable.__init__`.
`EvTable.__init__`.
""" """
self.width = kwargs.pop("width", self.width) self.width = kwargs.pop("width", self.width)
@ -1484,7 +1492,9 @@ class EvTable(object):
Args: Args:
index (int): Which column to reformat. The column index is index (int): Which column to reformat. The column index is
given from 0 to Ncolumns-1. given from 0 to Ncolumns-1.
kwargs (various, optional): Column options as per `EvCell.__init__`.
Kwargs:
Column options as per `EvCell.__init__`.
Raises: Raises:
Exception: if an invalid index is found. Exception: if an invalid index is found.