def sincronizar(self): print("Sincronizar case") planilh = planilha.Planilha() plants = fNk.readFileToArray("userInput.txt") s = sinc.Sincronizador() s.syncDatabase(plants) pass
def makeRequestsTests(self,macrofitasXls): planilha = pl.Planilha() p1 = planilha.openPlantsXls(macrofitasXls) #p = planilha.listStartsWith(p1,'Dactyloctenium aegyptium') for plant in p1: request = SpeciesRequest(plant,self.decoder,self.manager) request.makeRequests() return self.manager
def convertAllToCsv(self): planilhaObj = planilha.Planilha() ocurrencesStringArrays = [] for ocurrence in self.ocurrences: ocurrencesStringArrays.append(ocurrence.toArray()) planilhaObj.writeCsv('generatedDocs/speciesLink.csv', [ 'planta', 'coletador', 'local', 'pais', 'estado', 'cidade', 'latitude', 'longitude', 'data' ], ocurrencesStringArrays)
def load(self, path, filename): planilh = planilha.Planilha() cam = (filename[0]) print(cam) p = planilh.openPlantsXls(cam) plantsStr = "" for plant in p: plantsStr += plant + "\n" fNk.writeToFile("userInput.txt", plantsStr) print("userInput.txt gerado") self.dismiss_popup()
def makeRequestsTests(self, macrofitasXls): planilha = pl.Planilha() p = planilha.openPlantsXls(macrofitasXls) for plant in p: print(plant) try: result = tpl.roda(plant) except: time.sleep(10) result = tpl.roda(plant) if (result) == 0: self.nonExistent.append(plant)
def makeRequestsTests(self,macrofitasXls): plantsOcurrences = {} ocurrencesManager = oc.OcurrencesManager() planilha = pl.Planilha() p = planilha.openPlantsXls(macrofitasXls) for plant in p: try: self.processRequest(plant,ocurrencesManager) except: time.sleep(10) self.processRequest(plant,ocurrencesManager) ocurrencesManager.writeAllToDb() return ocurrencesManager
def makeRequestsTest(self,macrofitasXls): planilha = pl.Planilha() p = planilha.openPlantsXls(macrofitasXls) #p = planilha.listStartsWith(p,'Stemodia pratensis') for plant in p: print(plant) frequest = FloraRequest(plant) result = frequest.makeRequest() if result!=1 and result!=0: self.sinonimos.append(plant) request2 = FloraRequest(result) request2.makeRequest() elif result==0: self.nonExistent.append(plant) print("Nonexistents on Flora") for nonExistent in self.nonExistent: print(nonExistent)
def nomesvalidos(self): PLa = cone.DAOPlant() if PLa.tableIsEmpty() == False: print("Plants table case") planilh = planilha.Planilha() plants = fNk.readFileToArray("userInput.txt") s = sinc.Sincronizador() s.mountPlantsTable(plants) else: content = Label( text= 'Os requisitos para essa execução não foram atendidos. É necessário sincronizar.' ) self._popup = Popup(title="Erro", content=content, size_hint=(0.9, 0.9)) self._popup.open() Clock.schedule_once(self.dismiss_popup, 4)
def speciesl(self): daoOcurrenc = cone.DAOOcurrence() if daoOcurrenc.tableIsEmpty() == False: print("Ocurrences table case") planilh = planilha.Planilha() plants = fNk.readFileToArray("userInput.txt") s = sinc.Sincronizador() s.mountOcurrencesTable(plants) #gera planilha das ocorrencias do species pass else: content = Label( text= 'Os requisitos para essa execução não foram atendidos. É necessário sincronizar.' ) self._popup = Popup(title="Erro", content=content, size_hint=(0.9, 0.9)) self._popup.open() Clock.schedule_once(self.dismiss_popup, 4) pass
def florxtpl(self): flora = cone.DAOPlant() species = cone.DAOOcurrence() if ((flora.tableIsEmpty() == False) and (species.tableIsEmpty() == False)): print("Comparative table case") planilh = planilha.Planilha() plants = fNk.readFileToArray("userInput.txt") s = sinc.Sincronizador() s.mountComparativeCsv(plants) print("nada vazio, tudo certo") else: content = Label( text= 'Os requisitos para essa execução não foram atendidos. É necessário sincronizar.' ) self._popup = Popup(title="Erro", content=content, size_hint=(0.9, 0.9)) self._popup.open() Clock.schedule_once(self.dismiss_popup, 4)
def __init__(self): self.connection = con.Connection() self.daoPlant = con.DAOPlant() self.daoOcurrence = con.DAOOcurrence() self.planilha = pl.Planilha() self.plantasCorretas = []