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

Method set_value

config/settings.py:83–95  ·  view source on GitHub ↗
(section, key, value)

Source from the content-addressed store, hash-verified

81
82 @staticmethod
83 def set_value(section, key, value):
84 if section in Settings.setting:
85 if key in Settings.setting[section]:
86 if isinstance(value, bool):
87 Settings.setting[section][key]=Settings.parseBool(value)
88 else:
89 Settings.setting[section][key]=value
90 else:
91 message = locale.get("errors.section_config_error")
92 raise MapXploreException(message=message.format(section=section))
93 else:
94 message = locale.get("errors.section_config_error")
95 raise MapXploreException(message=message.format(section=section))
96
97 @staticmethod
98 def save_settings(filename:str, override=False)->None:

Callers 4

do_setMethod · 0.45
do_setMethod · 0.45
load_settingsMethod · 0.45
databaseMethod · 0.45

Calls 3

MapXploreExceptionClass · 0.90
parseBoolMethod · 0.80
formatMethod · 0.45

Tested by

no test coverage detected