mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
Issue #4832: Modify IDLE to save files with .py extension by
default on Windows and OS X as it already does with X11 Tk.
This commit is contained in:
parent
78da3bc0af
commit
c65ef9bf55
2 changed files with 9 additions and 2 deletions
|
@ -485,6 +485,8 @@ class IOBinding:
|
||||||
("All files", "*"),
|
("All files", "*"),
|
||||||
]
|
]
|
||||||
|
|
||||||
|
defaultextension = '.py' if sys.platform == 'darwin' else ''
|
||||||
|
|
||||||
def askopenfile(self):
|
def askopenfile(self):
|
||||||
dir, base = self.defaultfilename("open")
|
dir, base = self.defaultfilename("open")
|
||||||
if not self.opendialog:
|
if not self.opendialog:
|
||||||
|
@ -508,8 +510,10 @@ class IOBinding:
|
||||||
def asksavefile(self):
|
def asksavefile(self):
|
||||||
dir, base = self.defaultfilename("save")
|
dir, base = self.defaultfilename("save")
|
||||||
if not self.savedialog:
|
if not self.savedialog:
|
||||||
self.savedialog = tkFileDialog.SaveAs(master=self.text,
|
self.savedialog = tkFileDialog.SaveAs(
|
||||||
filetypes=self.filetypes)
|
master=self.text,
|
||||||
|
filetypes=self.filetypes,
|
||||||
|
defaultextension=self.defaultextension)
|
||||||
filename = self.savedialog.show(initialdir=dir, initialfile=base)
|
filename = self.savedialog.show(initialdir=dir, initialfile=base)
|
||||||
return filename
|
return filename
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,9 @@
|
||||||
What's New in IDLE 3.3.0?
|
What's New in IDLE 3.3.0?
|
||||||
=========================
|
=========================
|
||||||
|
|
||||||
|
- Issue #4832: Modify IDLE to save files with .py extension by
|
||||||
|
default on Windows and OS X (Tk 8.5) as it already does with X11 Tk.
|
||||||
|
|
||||||
- Issue #13532, #15319: Check that arguments to sys.stdout.write are strings.
|
- Issue #13532, #15319: Check that arguments to sys.stdout.write are strings.
|
||||||
|
|
||||||
- Issue # 12510: Attempt to get certain tool tips no longer crashes IDLE.
|
- Issue # 12510: Attempt to get certain tool tips no longer crashes IDLE.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue