MCPcopy Create free account
hub / github.com/CJackHwang/AIstudioProxyAPI / _save_config

Method _save_config

gui/app.py:145–161  ·  view source on GitHub ↗

Save configuration to file.

(self)

Source from the content-addressed store, hash-verified

143 return DEFAULT_CONFIG.copy()
144
145 def _save_config(self):
146 """Save configuration to file."""
147 try:
148 config = {
149 "fastapi_port": int(self.fastapi_port.get() or 2048),
150 "stream_port": int(self.stream_port.get() or 3120),
151 "proxy_address": self.proxy_address.get(),
152 "proxy_enabled": self.proxy_enabled.get(),
153 "last_account": self.selected_account.get(),
154 "appearance_mode": get_appearance_mode(),
155 "minimize_to_tray": True,
156 "language": get_language(),
157 }
158 with open(CONFIG_FILE, "w", encoding="utf-8") as f:
159 json.dump(config, f, indent=2, ensure_ascii=False)
160 except Exception as e:
161 self._log(get_text("log_config_save_error", error=str(e)))
162
163 def _bind_shortcuts(self):
164 """Bind keyboard shortcuts."""

Callers 8

_change_languageMethod · 0.95
_save_and_notifyMethod · 0.95
_reset_configMethod · 0.95
_startMethod · 0.95
_close_completelyMethod · 0.95

Calls 5

_logMethod · 0.95
get_appearance_modeFunction · 0.85
get_languageFunction · 0.85
get_textFunction · 0.85
getMethod · 0.45

Tested by

no test coverage detected