def progress(doing, pg, op): Wait.printProgressBar(pg, op, prefix='Progress:', suffix=' ' * 50, length=50) Wait.printProgressBar(pg, op, prefix='Progress:', suffix='Doing: ' + doing, length=50)
years, rowWithYear = findYears(data) print("Starting Inserstion") print(years) print(rowWithYear) regionRow = "Unnamed: 0" communeRow = "Unnamed: 1" institution = "Unnamed: 2" i = rowWithYear + 1 Wait.printProgressBar(i, len(data) - 1, prefix='Progress:', suffix='Complete', length=50) while i < len(data) - 1: school = data[institution][i] region = data[regionRow][i] commune = data[communeRow][i] # Check for total or empty row if (str(school) == "nan"): i += 1 continue for y in years: studentNumber = data[years[y][0]][i] # print(studentNumber)
# Fetching instructions from /instructions instructions = glob.glob(path + "/fetch/instructions/*.json") # Running throug all instructions json and performing # instrcutions in the files. for instruction in instructions: timeOutError = False with open(instruction) as f: data = json.load(f) operations = len(data["instructions"]) progression = 0 Wait.printProgressBar(progression, operations, prefix='Progress:', suffix='Complete', length=50) for command in data["instructions"]: if timeOutError: progress("TIMEOUT ERROR", progression, operations) break if "get" in command: progress("get", progression, operations) browser.get(command["get"]) if "wait" in command: progress("Waiting for " + str(command["wait"]) + " sec", progression, operations) sleep(command["wait"]) if "switch" in command: