MCPcopy Create free account
hub / github.com/daniel2005d/mapXplore / load_settings

Method load_settings

config/settings.py:113–130  ·  view source on GitHub ↗
(filename:str)

Source from the content-addressed store, hash-verified

111
112 @staticmethod
113 def load_settings(filename:str)->None:
114
115 try:
116 filename = os.path.expanduser(filename)
117 if not Util.check_file(filename):
118 raise MapXploreException(message=locale.get("errors.file_not_exists").format(file=filename))
119 else:
120 with open(filename, "r") as jfile:
121 json_data = json.load(jfile)
122 for section in Settings.setting:
123 for subsection in Settings.setting[section]:
124 if section in json_data:
125 if subsection in json_data[section]:
126 Settings.set_value(section, subsection, json_data[section][subsection])
127
128 #Settings.setting.update(json_data)
129 except Exception as e:
130 raise MapXploreException(message=str(e))
131
132 @staticmethod
133 def get_principal_db(dbms)->str:

Callers 2

do_loadMethod · 0.80
__init__Method · 0.80

Calls 4

MapXploreExceptionClass · 0.90
check_fileMethod · 0.80
formatMethod · 0.45
set_valueMethod · 0.45

Tested by

no test coverage detected