summaryrefslogtreecommitdiff
path: root/Lib/idlelib/IOBinding.py
diff options
context:
space:
mode:
authorR David Murray <rdmurray@bitdance.com>2013-03-07 18:16:47 -0500
committerR David Murray <rdmurray@bitdance.com>2013-03-07 18:16:47 -0500
commitd7fefe24a2289c2e077fc8d6703273d0dcb220bc (patch)
treef64cd20b6f37188146b27805dad42c7907a0a25e /Lib/idlelib/IOBinding.py
parentf0f272e28bdfa346c33bcacd4a78df4bbf837b67 (diff)
parentc2051f1fa112c1dc2b28d65e597eda85cb2e56ea (diff)
downloadcpython-d7fefe24a2289c2e077fc8d6703273d0dcb220bc.tar.gz
Merge: PEP8 fixup on previous patch, remove unused imports in test_email.
Diffstat (limited to 'Lib/idlelib/IOBinding.py')
-rw-r--r--Lib/idlelib/IOBinding.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/Lib/idlelib/IOBinding.py b/Lib/idlelib/IOBinding.py
index c4f14efc27..9fe0701133 100644
--- a/Lib/idlelib/IOBinding.py
+++ b/Lib/idlelib/IOBinding.py
@@ -1,6 +1,6 @@
import os
import types
-import pipes
+import shlex
import sys
import codecs
import tempfile
@@ -459,7 +459,7 @@ class IOBinding:
else: #no printing for this platform
printPlatform = False
if printPlatform: #we can try to print for this platform
- command = command % pipes.quote(filename)
+ command = command % shlex.quote(filename)
pipe = os.popen(command, "r")
# things can get ugly on NT if there is no printer available.
output = pipe.read().strip()
@@ -486,6 +486,8 @@ class IOBinding:
("All files", "*"),
]
+ defaultextension = '.py' if sys.platform == 'darwin' else ''
+
def askopenfile(self):
dir, base = self.defaultfilename("open")
if not self.opendialog:
@@ -509,8 +511,10 @@ class IOBinding:
def asksavefile(self):
dir, base = self.defaultfilename("save")
if not self.savedialog:
- self.savedialog = tkFileDialog.SaveAs(master=self.text,
- filetypes=self.filetypes)
+ self.savedialog = tkFileDialog.SaveAs(
+ master=self.text,
+ filetypes=self.filetypes,
+ defaultextension=self.defaultextension)
filename = self.savedialog.show(initialdir=dir, initialfile=base)
return filename