def tomarCaptura(hClinic): inputs.pulsarTecla(inputs.Key.alt) inputs.pulsarTecla('e') inputs.pulsarTecla(inputs.Key.space) inputs.time.sleep(1) inputs.combTeclas(inputs.Key.ctrl, inputs.Key.tab) inputs.pulsarTecla(inputs.Key.enter) inputs.escribir(hClinic) inputs.pulsarTecla(inputs.Key.enter) inputs.combTeclas(inputs.Key.alt, inputs.Key.f4) inputs.pulsarTecla(inputs.Key.enter) inputs.time.sleep(1) return hClinic + '.txt'
def recolectarHC(ind, hClinic, date, nPant): for i in range(0, ind): inputs.pulsarTecla(inputs.Key.down) inputs.pulsarTecla('6') inputs.pulsarTeclaDeley(inputs.Key.enter) finalFlag = True while finalFlag: inputs.pulsarTecla(inputs.Key.alt) inputs.pulsarTecla('e') inputs.pulsarTecla(inputs.Key.space) inputs.time.sleep(1) inputs.combTeclas(inputs.Key.ctrl, inputs.Key.tab) inputs.pulsarTecla(inputs.Key.enter) inputs.time.sleep(1) ndate = date[0:4] + '-' + date[5:7] + '-' + date[8:10] + '-' filename = hClinic + '-' + ndate + str(nPant) inputs.escribir(filename) inputs.pulsarTecla(inputs.Key.enter) inputs.time.sleep(1) inputs.combTeclas(inputs.Key.alt, inputs.Key.f4) inputs.pulsarTecla(inputs.Key.enter) inputs.time.sleep(1) #try: if inputs.checkscreen(filename) == 0: finalFlag = False #except: # print("Error") # pass #inputs.time.sleep(1) inputs.pulsarTecla(inputs.Key.page_down) nPant += 1 inputs.time.sleep(1) inputs.pulsarTecla(inputs.Key.f3) inputs.time.sleep(1) return nPant
stopExt = True ptCounter = 1 csvFechas = verFechas.extractCSV("pacfecha.csv", hClinic) while stopExt: screenCp = shortcutsNewSaves.tomarCaptura(hClinic + str(ptCounter)) screenFechas = verFechas.extractFechasScreen(screenCp) for date in csvFechas: nFechRep = 1 for i in range(0, len(screenFechas)): if screenFechas[i] == date: shortcutsNewSaves.recolectarHC(i, hClinic, date, ptCounter, nFechRep) nFechRep += 1 for date in screenFechas: if int(date[0:4]) <= 2017: stopExt = False break if inputs.checkscreen(screenCp) != 0: inputs.pulsarTecla(inputs.Key.page_down) else: stopExt = False ptCounter += 1 inputs.combTeclas(inputs.Key.f3, inputs.Key.f3) inputs.pulsarTecla(inputs.Key.f3) inputs.pulsarTecla(inputs.Key.f3) inputs.time.sleep(1)