示例#1
0
 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
示例#2
0
 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
示例#3
0
 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
示例#4
0
 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