def OnGeoExtract(self,evt): try: wikiextractor = Extractor.wikiextractor() data_dict={} members=self.GetGeoList() wikiextractor.get_data_dict_from_pageid(members, data_dict,'f') filewriter=FileWriter.filewriter() filewriter.SaveToSQLite(data_dict) #filewriter.SaveToExcel(data_dict) self.statusbar.SetStatusText("保存成功,请检查excel文件",0) except Exception,e: self.statusbar.SetStatusText(e.message,0)
def OnExtract(self,evt): try: categoryname = self.categoryname.GetValue() wikiextractor = Extractor.wikiextractor() data_dict = {} if self.extractsubcategoryck.Get3StateValue() == wx.CHK_CHECKED: wikiextractor.parse_members(categoryname, data_dict,'t') else: wikiextractor.parse_members(categoryname, data_dict,'f') filewriter=FileWriter.filewriter() #filewriter.SaveToSQLite(data_dict) filewriter.SaveToExcel(data_dict) self.statusbar.SetStatusText(u"保存成功,请检查excel文件",0) except Exception,e: self.statusbar.SetStatusText(e.message,0)
def OnGeoSave(self,evt): filewriter=FileWriter.filewriter() filewriter.SaveToCSV(self.resultdict)