diff --git a/src/pis.py b/src/pis.py index b00810b..f9ddce8 100644 --- a/src/pis.py +++ b/src/pis.py @@ -27,13 +27,16 @@ def requiresUpdate(): with open(file_location, "r") as f: text = f.read() newHash = hashlib.md5(text.encode()).hexdigest() + log.out(f"pis.requiresUpdate: Existing PIS Hash: {currentHash}","INFO") + log.out(f"pis.requiresUpdate: New PIS hash: {newHash}", "INFO") if currentHash is None or newHash != currentHash: - log.out(f"pis.requiresUpdate: currentHash: {currentHash}, newHash: {newHash}", "INFO") + log.out("pis.requiredUpdate: PIS Data requires updating", "INFO") mongo.putMetaHash("pis", newHash) return True + log.out("pis.requiredUpdate: PIS Data is up to date", "INFO") return False -def load(): # Programatically add a `toc` field to each entry. +def load(): with open(file_location, "r") as data: try: pis = yaml.safe_load(data) @@ -64,13 +67,11 @@ def parse(codeList): def getTiploc(crs :str): CRS = crs.upper() - #log.out(f"pis.getTiploc: Finding TIPLOC for {CRS}") query = { '3ALPHA': CRS } try: res = mongo.query("stations", query) - #print(res) if 'TIPLOC' in res: return res['TIPLOC'] except Exception as e: