Esempio n. 1
0
 def cell(self,rdrowx,rdcolx,wtrowx,wtcolx):
     cell = self.rdsheet.cell(rdrowx,rdcolx)
     if cell.ctype == xlrd.XL_CELL_EMPTY:
         return
     if cell.ctype == xlrd.XL_CELL_ERROR:
         logger.error("Cell %s of sheet %r contains a bad value: %s" % (
                     xlrd.cellname(rdrowx, rdcolx),
                     quoted_sheet_name(self.rdsheet.name),
                     cell_display(cell,self.rdbook.datemode),
                     ))
         return
     BaseWriter.cell(self,rdrowx,rdcolx,wtrowx,wtcolx)
Esempio n. 2
0
 def flush(self):
     if self.rdsheet is not None:
         rsn = None
         for ra in self.ranges:
             if rsn is None:
                 rsn = ra.rsn
             elif ra.rsn!=rsn:
                 self.rdsheet = self.rdbook.sheet_by_name(ra.rsn)
                 self.next.set_rdsheet(self.rdsheet)
                 rsn = ra.rsn
             for r in range(ra.r):
                 for c in range(ra.c):
                     wtcolx=ra.wc+c
                     if wtcolx<=self.max_nonjunk:
                         self.next.cell(ra.rr+r,ra.rc+c,ra.wr+r,ra.wc+c)
         if self.max!=self.max_nonjunk:
             logger.debug("Number of columns trimmed from %d to %d for sheet %r",
                          self.max+1,
                          self.max_nonjunk+1,
                          quoted_sheet_name(self.wtsheet_name))
     self.start(chain=False)