I am dissecting gluon/contrib/spreadsheet.py and I am trying to
understand the ff:

class Sheet:

    <snip>

    def __init__(self, rows, cols, url='.', readonly=False,
active=True,
            onchange=None):
        self.rows = rows
        self.cols = cols
        self.url = url
        self.nodes = {}
        self.error = 'ERROR: %(error)s'
        self.allowed_keywords = ['for', 'in', 'if', 'else', 'and',
'or', 'not',
                               'i', 'j', 'k', 'x', 'y', 'z', 'sum']
        self.environment = {}
        [self.cell('r%sc%s'%(k/cols, k%cols), '0.0', readonly, active,
onchange)
            for k in xrange(rows*cols)]

That last part, 
http://code.google.com/p/web2py/source/browse/gluon/contrib/spreadsheet.py#115,
what does it do? Does it create an array of cells which I can access
with Sheet[index]?

Will it be possible to define two arrays in Sheet?

My objective in this exercise is to cut down the Sheet class to just
define an array (or arrays) to directly store values (not a dict). I
intend to modify that last part to just [0 for k in
xrange(rows*cols)].


Reply via email to