Example #1
0
 def read(i, src):
     "Fo all rows in src, fill in the table."
     for lst in cells(cols(rows(src))):
         if i.cols:
             lst = [col + x for col, x in zip(i.cols.all, lst)]
             i.rows += [Row(lst)]
         else:
             i.cols = Cols(lst)
     return i
Example #2
0
 def read(i, src):
     "Fo all rows in src, fill in the table."
     for n, lst in enumerate(cells(cols(rows(src)))):
         if n == 0:
             i.header = lst
         if i.cols:
             lst = [col + x for col, x in zip(i.cols.all, lst)]
             i.rows += [Row(lst)]
         else:
             i.cols = Cols(lst)
     return i
 def clone(i):
     "Create an empty table of the same form as self."
     return Tbl(Cols(i.cols.names))