def cell(self, rdrowx, rdcolx, wtrowx, wtcolx): if wtcolx > self.max: self.max = wtcolx cell = self.rdsheet.cell(rdrowx, rdcolx) if wtcolx > self.max_nonjunk and not cells_all_junk((cell,), self.is_junk): self.max_nonjunk = wtcolx if not self.ranges: self.add_range(rdrowx, rdcolx, wtrowx, wtcolx) elif self.pending_rdsheet is not None: self.add_range(rdrowx, rdcolx, wtrowx, wtcolx) self.pending_rdsheet = None else: r = self.ranges[-1] if rdrowx == r.rr and wtrowx == r.wr and rdcolx == r.rc + r.c and wtcolx == r.wc + r.c: r.c += 1 else: self.add_range(rdrowx, rdcolx, wtrowx, wtcolx)
def cell(self,rdrowx,rdcolx,wtrowx,wtcolx): if wtcolx>self.max: self.max = wtcolx cell = self.rdsheet.cell(rdrowx,rdcolx) if wtcolx>self.max_nonjunk and not cells_all_junk((cell,),self.is_junk): self.max_nonjunk = wtcolx if not self.ranges: self.add_range(rdrowx,rdcolx,wtrowx,wtcolx) elif self.pending_rdsheet is not None: self.add_range(rdrowx,rdcolx,wtrowx,wtcolx) self.pending_rdsheet = None else: r = self.ranges[-1] if rdrowx==r.rr and wtrowx==r.wr and rdcolx==r.rc+r.c and wtcolx==r.wc+r.c: r.c+=1 else: self.add_range(rdrowx,rdcolx,wtrowx,wtcolx)
def row_index(sheet): for i in xrange(sheet.nrows - 1, -1, -1): if not cells_all_junk(sheet.row_slice(i, 0, 2)): return i + 1 return 0