summaryrefslogtreecommitdiffstats
path: root/Lib/idlelib
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/idlelib')
-rw-r--r--Lib/idlelib/Bindings.py4
-rw-r--r--Lib/idlelib/CREDITS.txt4
-rw-r--r--Lib/idlelib/CodeContext.py2
-rw-r--r--Lib/idlelib/NEWS.txt24
-rw-r--r--Lib/idlelib/PyShell.py59
-rw-r--r--Lib/idlelib/idlever.py2
6 files changed, 63 insertions, 32 deletions
diff --git a/Lib/idlelib/Bindings.py b/Lib/idlelib/Bindings.py
index d24be3f..a3c9fc4 100644
--- a/Lib/idlelib/Bindings.py
+++ b/Lib/idlelib/Bindings.py
@@ -22,9 +22,9 @@ menudefs = [
None,
('_Save', '<<save-window>>'),
('Save _As...', '<<save-window-as-file>>'),
- ('Save Co_py As...', '<<save-copy-of-window-as-file>>'),
+ ('Save Cop_y As...', '<<save-copy-of-window-as-file>>'),
None,
- ('_Print Window', '<<print-window>>'),
+ ('Prin_t Window', '<<print-window>>'),
None,
('_Close', '<<close-window>>'),
('E_xit', '<<close-all-windows>>'),
diff --git a/Lib/idlelib/CREDITS.txt b/Lib/idlelib/CREDITS.txt
index e838c03..30561a9 100644
--- a/Lib/idlelib/CREDITS.txt
+++ b/Lib/idlelib/CREDITS.txt
@@ -24,8 +24,8 @@ Noam Raphael (Code Context, Call Tips, many other patches), and Chui Tey (RPC
integration, debugger integration and persistent breakpoints).
Scott David Daniels, Tal Einat, Hernan Foffani, Christos Georgiou,
-Martin v. Löwis, Jason Orendorff, Josh Robb, Nigel Rowe, Bruce Sherwood,
-and Jeff Shute have submitted useful patches. Thanks, guys!
+Jim Jewett, Martin v. Löwis, Jason Orendorff, Josh Robb, Nigel Rowe,
+Bruce Sherwood, and Jeff Shute have submitted useful patches. Thanks, guys!
For additional details refer to NEWS.txt and Changelog.
diff --git a/Lib/idlelib/CodeContext.py b/Lib/idlelib/CodeContext.py
index 63cc82c..74d5b70 100644
--- a/Lib/idlelib/CodeContext.py
+++ b/Lib/idlelib/CodeContext.py
@@ -15,7 +15,7 @@ import re
from sys import maxint as INFINITY
BLOCKOPENERS = set(["class", "def", "elif", "else", "except", "finally", "for",
- "if", "try", "while"])
+ "if", "try", "while", "with"])
UPDATEINTERVAL = 100 # millisec
FONTUPDATEINTERVAL = 1000 # millisec
diff --git a/Lib/idlelib/NEWS.txt b/Lib/idlelib/NEWS.txt
index 235963e..3b3d79a 100644
--- a/Lib/idlelib/NEWS.txt
+++ b/Lib/idlelib/NEWS.txt
@@ -1,7 +1,29 @@
+What's New in IDLE 2.6a1?
+=========================
+
+*Release date: XX-XXX-200X*
+
+- IDLE's version number takes a big jump to match the version number of
+ the Python release of which it's a part.
+
+
What's New in IDLE 1.2c1?
=========================
-*Release date: XX-AUG-2006*
+*Release date: 17-AUG-2006*
+
+- File menu hotkeys: there were three 'p' assignments. Reassign the
+ 'Save Copy As' and 'Print' hotkeys to 'y' and 't'. Change the
+ Shell hotkey from 's' to 'l'.
+
+- IDLE honors new quit() and exit() commands from site.py Quitter() object.
+ Patch 1540892, Jim Jewett
+
+- The 'with' statement is now a Code Context block opener.
+ Patch 1540851, Jim Jewett
+
+- Retrieval of previous shell command was not always preserving indentation
+ (since 1.2a1) Patch 1528468 Tal Einat.
- Changing tokenize (39046) to detect dedent broke tabnanny check (since 1.2a1)
diff --git a/Lib/idlelib/PyShell.py b/Lib/idlelib/PyShell.py
index 25eb446..d8befff 100644
--- a/Lib/idlelib/PyShell.py
+++ b/Lib/idlelib/PyShell.py
@@ -478,9 +478,6 @@ class ModifiedInterpreter(InteractiveInterpreter):
import sys as _sys
_sys.path = %r
del _sys
- _msg = 'Use File/Exit or your end-of-file key to quit IDLE'
- __builtins__.quit = __builtins__.exit = _msg
- del _msg
\n""" % (sys.path,))
active_seq = None
@@ -514,7 +511,10 @@ class ModifiedInterpreter(InteractiveInterpreter):
print >>sys.__stderr__, errmsg, what
print >>console, errmsg, what
# we received a response to the currently active seq number:
- self.tkconsole.endexecuting()
+ try:
+ self.tkconsole.endexecuting()
+ except AttributeError: # shell may have closed
+ pass
# Reschedule myself
if not self.tkconsole.closing:
self.tkconsole.text.after(self.tkconsole.pollinterval,
@@ -593,7 +593,7 @@ class ModifiedInterpreter(InteractiveInterpreter):
source = source.encode(IOBinding.encoding)
except UnicodeError:
self.tkconsole.resetoutput()
- self.write("Unsupported characters in input")
+ self.write("Unsupported characters in input\n")
return
try:
# InteractiveInterpreter.runsource() calls its runcode() method,
@@ -713,14 +713,17 @@ class ModifiedInterpreter(InteractiveInterpreter):
else:
exec code in self.locals
except SystemExit:
- if tkMessageBox.askyesno(
- "Exit?",
- "Do you want to exit altogether?",
- default="yes",
- master=self.tkconsole.text):
- raise
+ if not self.tkconsole.closing:
+ if tkMessageBox.askyesno(
+ "Exit?",
+ "Do you want to exit altogether?",
+ default="yes",
+ master=self.tkconsole.text):
+ raise
+ else:
+ self.showtraceback()
else:
- self.showtraceback()
+ raise
except:
if use_subprocess:
print >> self.tkconsole.stderr, \
@@ -730,7 +733,10 @@ class ModifiedInterpreter(InteractiveInterpreter):
self.tkconsole.endexecuting()
finally:
if not use_subprocess:
- self.tkconsole.endexecuting()
+ try:
+ self.tkconsole.endexecuting()
+ except AttributeError: # shell may have closed
+ pass
def write(self, s):
"Override base class method"
@@ -794,7 +800,7 @@ class PyShell(OutputWindow):
if use_subprocess:
ms = self.menu_specs
if ms[2][0] != "shell":
- ms.insert(2, ("shell", "_Shell"))
+ ms.insert(2, ("shell", "She_ll"))
self.interp = ModifiedInterpreter(self)
if flist is None:
root = Tk()
@@ -804,9 +810,6 @@ class PyShell(OutputWindow):
#
OutputWindow.__init__(self, flist, None, None)
#
- import __builtin__
- __builtin__.quit = __builtin__.exit = "To exit, type Ctrl-D."
- #
## self.config(usetabs=1, indentwidth=8, context_use_ps1=1)
self.usetabs = True
# indentwidth must be 8 when using tabs. See note in EditorWindow:
@@ -1138,21 +1141,27 @@ class PyShell(OutputWindow):
return "break"
def recall(self, s, event):
+ # remove leading and trailing empty or whitespace lines
+ s = re.sub(r'^\s*\n', '' , s)
+ s = re.sub(r'\n\s*$', '', s)
+ lines = s.split('\n')
self.text.undo_block_start()
try:
self.text.tag_remove("sel", "1.0", "end")
self.text.mark_set("insert", "end-1c")
- s = s.strip()
- lines = s.split('\n')
- prefix = self.text.get("insert linestart","insert").rstrip()
- if prefix and prefix[-1]==':':
+ prefix = self.text.get("insert linestart", "insert")
+ if prefix.rstrip().endswith(':'):
self.newline_and_indent_event(event)
- self.text.insert("insert",lines[0].strip())
+ prefix = self.text.get("insert linestart", "insert")
+ self.text.insert("insert", lines[0].strip())
if len(lines) > 1:
- self.newline_and_indent_event(event)
+ orig_base_indent = re.search(r'^([ \t]*)', lines[0]).group(0)
+ new_base_indent = re.search(r'^([ \t]*)', prefix).group(0)
for line in lines[1:]:
- self.text.insert("insert", line.strip())
- self.newline_and_indent_event(event)
+ if line.startswith(orig_base_indent):
+ # replace orig base indentation with new indentation
+ line = new_base_indent + line[len(orig_base_indent):]
+ self.text.insert('insert', '\n'+line.rstrip())
finally:
self.text.see("insert")
self.text.undo_block_stop()
diff --git a/Lib/idlelib/idlever.py b/Lib/idlelib/idlever.py
index 07d3d82..f56b4d4 100644
--- a/Lib/idlelib/idlever.py
+++ b/Lib/idlelib/idlever.py
@@ -1 +1 @@
-IDLE_VERSION = "1.2b3"
+IDLE_VERSION = "2.6a0"