MCPcopy Index your code
hub / github.com/python/cpython / _fixresult

Method _fixresult

Lib/tkinter/filedialog.py:337–349  ·  view source on GitHub ↗
(self, widget, result)

Source from the content-addressed store, hash-verified

335 command = "tk_getOpenFile"
336
337 def _fixresult(self, widget, result):
338 if isinstance(result, tuple):
339 # multiple results:
340 result = tuple([getattr(r, "string", r) for r in result])
341 if result:
342 path, file = os.path.split(result[0])
343 self.options["initialdir"] = path
344 # don't set initialfile or filename, as we have multiple of these
345 return result
346 if not widget.tk.wantobjects() and "multiple" in self.options:
347 # Need to split result explicitly
348 return self._fixresult(widget, widget.tk.splitlist(result))
349 return _Dialog._fixresult(self, widget, result)
350
351
352class SaveAs(_Dialog):

Callers 1

test_fixresultMethod · 0.45

Calls 3

wantobjectsMethod · 0.80
splitlistMethod · 0.80
splitMethod · 0.45

Tested by 1

test_fixresultMethod · 0.36