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

Method save_settings

config/settings.py:98–110  ·  view source on GitHub ↗
(filename:str, override=False)

Source from the content-addressed store, hash-verified

96
97 @staticmethod
98 def save_settings(filename:str, override=False)->None:
99
100 try:
101 filename = os.path.expanduser(filename)
102 if Util.check_file(filename) and not override:
103 raise MapXploreException(message_key="file_exists", isError=False)
104 else:
105 with open(filename, "w") as jfile:
106 json.dump(Settings.setting, jfile)
107 except MapXploreException as e:
108 raise e
109 except Exception as e:
110 raise MapXploreException(e)
111
112 @staticmethod
113 def load_settings(filename:str)->None:

Callers 2

_ask_overwriteMethod · 0.80
do_saveMethod · 0.80

Calls 2

MapXploreExceptionClass · 0.90
check_fileMethod · 0.80

Tested by

no test coverage detected