From 22df76529b363eada30148c1f971aa2b63c5001a Mon Sep 17 00:00:00 2001 From: lForger Date: Fri, 8 Dec 2023 16:19:33 -0500 Subject: [PATCH] Figured out the write code to get the id w/o regex --- rpi_data/modules/prereq_parse.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/rpi_data/modules/prereq_parse.py b/rpi_data/modules/prereq_parse.py index 388a76c79..4a4a38361 100644 --- a/rpi_data/modules/prereq_parse.py +++ b/rpi_data/modules/prereq_parse.py @@ -38,6 +38,12 @@ def getCataId(self, year : int): root = tree.getroot() try: pdb.set_trace() + #currentCatalog = root.xpath("//*[local-name() = 'archived'][contains(text(), 'No')]") + #currentCatalog = root.xpath("//*[local-name() = 'archived']") + #tree.xpath("//*[local-name() = 'archived']")[0].getparent().getparent().attrib['id'] + #TODO: Rewrite in regex + #TODO: get the catalog id from this + retCata = root.xpath("//*[local-name() = 'archived']")[0].getparent().getparent().attrib['id'] return 0 except Exception as exception: print("Failed to get the catalog id")