From 46659d9bd5ae768677a3141dde2ec8efba03a8ee Mon Sep 17 00:00:00 2001 From: surtur Date: Thu, 16 Dec 2021 04:34:24 +0100 Subject: [PATCH] add parse_freqs() method --- da_detector.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/da_detector.py b/da_detector.py index 9f7d964..12c568b 100644 --- a/da_detector.py +++ b/da_detector.py @@ -27,3 +27,19 @@ class da_detector: except Exception as e: raise e return data + + def parse_freqs(self, path): + import json + + fullpath = freqs_folder + path + try: + with open(fullpath, 'r') as f: + j_data = f.read() + except Exception as e: + raise e + + try: + obj = json.loads(j_data) + except Exception as e: + raise e + return obj