def onExportAll(self,event): """ """ if not self._checkInputValid(): return workbook = ConfigParser.OpenExcel(self.mConfigPath.text()) for sheet in workbook.sheets(): s = ConfigParser.ExcelSheetParser(sheet,self.mExportPath.text()) s.Export() QMessageBox.information(self,"提示","导出完成")
def onExportSelect(self,event): """ """ if not self._checkInputValid(): return #找到需要导出的表 export_sheet = [] for i in range(self.mExcelTablesList.count()): cb = self.mExcelTablesList.itemWidget(self.mExcelTablesList.item(i)) if cb.isChecked(): export_sheet.append(cb.text()) #执行导出 workbook = ConfigParser.OpenExcel(self.mConfigPath.text()) for sheet in workbook.sheets(): if sheet.name in export_sheet: s = ConfigParser.ExcelSheetParser(sheet,self.mExportPath.text()) s.Export() QMessageBox.information(self,"提示","导出完成")