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

Method get_value

gui/widgets.py:294–309  ·  view source on GitHub ↗

Get the current value with proper type conversion.

(self)

Source from the content-addressed store, hash-verified

292 self._on_change(self._key, self.get_value())
293
294 def get_value(self) -> Any:
295 """Get the current value with proper type conversion."""
296 if self._type_hint == "bool":
297 return self._value_var.get()
298 elif self._type_hint == "int":
299 try:
300 return int(self._value_var.get())
301 except ValueError:
302 return 0
303 elif self._type_hint == "float":
304 try:
305 return float(self._value_var.get())
306 except ValueError:
307 return 0.0
308 else:
309 return self._value_var.get()
310
311 def set_value(self, value: Any) -> None:
312 """Set the value."""

Callers 1

_on_value_changeMethod · 0.95

Calls 1

getMethod · 0.45

Tested by

no test coverage detected