def sheet(self,rdsheet,wtsheet_name): self.rdsheet = rdsheet; BaseWriter.sheet(self,rdsheet,wtsheet_name);
def sheet(self,rdsheet,wtsheet_name): self.rdsheet = rdsheet; BaseWriter.sheet(self, rdsheet, wtsheet_name); if rdsheet.name == self.__rdSheetName: del self.merged_cell_top_left_map[(self.__cellRange[1],self.__cellRange[0])];
def sheet(self,rdsheet,wtsheet_name): self.rdsheet = rdsheet; self.wtsheet_name = wtsheet_name; if self.__sheetIndex > 0 and self.__mvIndex > 0: myIndex=self.sheetIndex(rdsheet.name); if myIndex == self.__mvIndex: if self.__pading_sheet is None: self.__pading_sheet = self.rdbook.sheet_by_name(self.__rdSheetName); BaseWriter.sheet(self, self.__pading_sheet, self.__rdSheetName); for row_x in xrange(self.__pading_sheet.nrows): BaseWriter.row(self, row_x,row_x); for col_x in xrange(self.__pading_sheet.row_len(row_x)): BaseWriter.cell(self, row_x,col_x,row_x,col_x); BaseWriter.sheet(self,rdsheet,wtsheet_name); elif self.__rdSheetName == rdsheet.name: self.__pading_sheet = rdsheet; # 复制sheet,并更改复制的位置 if self.__option == 2: BaseWriter.sheet(self, self.__pading_sheet, self.__wtSheetname); else: BaseWriter.sheet(self,rdsheet,wtsheet_name); else: if self.__rdSheetName == rdsheet.name: self.__pading_sheet = rdsheet; # 删除sheet if self.__option < 3 or self.__rdSheetName != rdsheet.name: BaseWriter.sheet(self,rdsheet,wtsheet_name); # 复制sheet if self.__option == 2 and rdsheet.name == self.rdbook.sheet_by_index(-1).name: BaseWriter.sheet(self, self.__pading_sheet, self.__wtSheetname); for row_x in xrange(self.__pading_sheet.nrows): BaseWriter.row(self, row_x,row_x); for col_x in xrange(self.__pading_sheet.row_len(row_x)): BaseWriter.cell(self, row_x,col_x,row_x,col_x);