diff --git a/common/global_call.py b/common/global_call.py index 3433ef7ec7a112260d2ff6e5634f789b416f5aa3..4289d94cc75802fa0ee6fd3ac081dbd481c4f59a 100644 --- a/common/global_call.py +++ b/common/global_call.py @@ -22,6 +22,23 @@ class GlobalCall: output_hotspot_file = "hotspotInfo.txt" output_custom_file = "custom.txt" + @staticmethod + def get_str_v(k , default ): + cfg = Config.get_json_dict() + arr = k.strip().split('.') + + while 1 < len(arr): + if arr[0] not in cfg: + return False, default + + cfg = cfg[arr[0]] + arr.remove(arr[0]) + + if arr[0] in cfg: + return True, str(cfg[arr[0]]) + else: + return False, default + @staticmethod def get_json_value(k , default, cfg = Config.get_json_dict()): '''