diff --git a/src/main.py b/src/main.py index de93c7d..c71495f 100644 --- a/src/main.py +++ b/src/main.py @@ -26,21 +26,10 @@ def get_json(url:str) -> list[dict]: raw = raw.decode('utf-8') # turn it into json - reader = csv.DictReader(raw) - arr = reader_to_json(reader) + arr = reader_to_json(csv.DictReader(raw.splitlines())) return arr -# DEBUG function. Loads a local file -def local_file(path:str) -> list[dict]: - with open(path, "r") as i: - reader:list = reader_to_json(csv.DictReader(i)) - - with open("out.json", "w") as o: - o.write(dumps(reader, indent=2)) - - return reader - # Gets file from the server def get_file(entries:int) -> dict: url = f"{ROOT}/Portal/Portal.mwsl?PriNav=DataLog&RecentCount={entries}" @@ -68,9 +57,6 @@ def save_file(json:list[dict], filename:str) -> None: def main(): file = get_file(10) - # DEBUG: local test file - #file = local_file("test.csv") - # Save file save_file(file, "out.json") if __name__ == "__main__":