From 8fa7eb563bb9a14651bcdc8ee60c5e45302c2f59 Mon Sep 17 00:00:00 2001 From: "Kurt B. Kaiser" Date: Tue, 21 Jun 2005 02:42:17 +0000 Subject: [PATCH] Remove dead code M IdleHistory.py M PyShell.py --- Lib/idlelib/IdleHistory.py | 8 -------- Lib/idlelib/PyShell.py | 20 ++++++++------------ 2 files changed, 8 insertions(+), 20 deletions(-) diff --git a/Lib/idlelib/IdleHistory.py b/Lib/idlelib/IdleHistory.py index f672db70e50..960242f7817 100644 --- a/Lib/idlelib/IdleHistory.py +++ b/Lib/idlelib/IdleHistory.py @@ -86,11 +86,3 @@ class History: self.history.append(source) self.history_pointer = None self.history_prefix = None - - def recall(self, s): - s = s.strip() - self.text.tag_remove("sel", "1.0", "end") - self.text.delete("iomark", "end-1c") - self.text.mark_set("insert", "end-1c") - self.text.insert("insert", s) - self.text.see("insert") diff --git a/Lib/idlelib/PyShell.py b/Lib/idlelib/PyShell.py index 8115e63dc72..bc3954e9d25 100644 --- a/Lib/idlelib/PyShell.py +++ b/Lib/idlelib/PyShell.py @@ -1134,19 +1134,15 @@ class PyShell(OutputWindow): self.text.mark_set("insert", "end-1c") s = s.strip() lines = s.split('\n') - if lines: - prefix = self.text.get("insert linestart","insert").rstrip() - if prefix and prefix[-1]==':': + prefix = self.text.get("insert linestart","insert").rstrip() + if prefix and prefix[-1]==':': + self.newline_and_indent_event(event) + self.text.insert("insert",lines[0].strip()) + if len(lines) > 1: + self.newline_and_indent_event(event) + for line in lines[1:]: + self.text.insert("insert", line.strip()) self.newline_and_indent_event(event) - - self.text.insert("insert",lines[0].strip()) - if len(lines) > 1: - self.newline_and_indent_event(event) - for line in lines[1:]: - self.text.insert("insert", line.strip()) - self.newline_and_indent_event(event) - else: - self.text.insert("insert", s) finally: self.text.see("insert") self.text.undo_block_stop()