| 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 | |
| 352 | class SaveAs(_Dialog): |