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

Method ok_command

Lib/tkinter/filedialog.py:253–272  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

251 title = "Save File Selection Dialog"
252
253 def ok_command(self):
254 file = self.get_selection()
255 if os.path.exists(file):
256 if os.path.isdir(file):
257 self.master.bell()
258 return
259 d = Dialog(self.top,
260 title="Overwrite Existing File Question",
261 text="Overwrite existing file %r?" % (file,),
262 bitmap='questhead',
263 default=1,
264 strings=("Yes", "Cancel"))
265 if d.num != 0:
266 return
267 else:
268 head, tail = os.path.split(file)
269 if not os.path.isdir(head):
270 self.master.bell()
271 return
272 self.quit(file)
273
274
275# For the following classes and modules:

Callers

nothing calls this directly

Calls 7

DialogClass · 0.90
get_selectionMethod · 0.45
existsMethod · 0.45
isdirMethod · 0.45
bellMethod · 0.45
splitMethod · 0.45
quitMethod · 0.45

Tested by

no test coverage detected