MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / _val_or_dict

Function _val_or_dict

tools/python-3.11.9-amd64/Lib/tkinter/ttk.py:272–286  ·  view source on GitHub ↗

Format options then call Tk command with args and options and return the appropriate result. If no option is specified, a dict is returned. If an option is specified with the None value, the value for that option is returned. Otherwise, the function just sets the passed options

(tk, options, *args)

Source from the content-addressed store, hash-verified

270 return res
271
272def _val_or_dict(tk, options, *args):
273 """Format options then call Tk command with args and options and return
274 the appropriate result.
275
276 If no option is specified, a dict is returned. If an option is
277 specified with the None value, the value for that option is returned.
278 Otherwise, the function just sets the passed options and the caller
279 shouldn't be expecting a return value anyway."""
280 options = _format_optdict(options)
281 res = tk.call(*(args + options))
282
283 if len(options) % 2: # option specified without a value, return its value
284 return res
285
286 return _splitdict(tk, res, conv=_tclobj_to_py)
287
288def _convert_stringval(value):
289 """Converts a value to, hopefully, a more appropriate Python object."""

Callers 7

configureMethod · 0.85
tabMethod · 0.85
paneMethod · 0.85
columnMethod · 0.85
headingMethod · 0.85
itemMethod · 0.85
tag_configureMethod · 0.85

Calls 3

_splitdictFunction · 0.90
_format_optdictFunction · 0.85
callMethod · 0.80

Tested by

no test coverage detected