def make(cls, *args, **kw): # convenience factory ncols = kw.get("ncols", 2) missingcols = ncols - (len(args) % ncols) args += ('',) * missingcols # add empty columns to fill the table table = cls(chop(args, ncols)) vars(table).update(kw) return table
def make(cls, *args, **kw): # convenience factory ncols = kw.get("ncols", 2) missingcols = ncols - (len(args) % ncols) args += ('', ) * missingcols # add empty columns to fill the table table = cls(chop(args, ncols)) vars(table).update(kw) return table
def __init__(self, body, header=[], maxsize=20): self.header = header self.maxsize = maxsize self.section = Cycle(chop(body, maxsize)) self.sect = self.section[0] # default self.ismultipage = len(self.section) > 1