summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKurt B. Kaiser <kbk@shore.net>2002-09-16 22:09:19 (GMT)
committerKurt B. Kaiser <kbk@shore.net>2002-09-16 22:09:19 (GMT)
commit6b06f29d095e5c99a8b495f23baff8244c624253 (patch)
tree7f9e4c62cc3c78341e7846fcc27e8c0be8ae2cd3
parent01166da85ad4387129975b42587652ea38cef7ef (diff)
downloadcpython-6b06f29d095e5c99a8b495f23baff8244c624253.zip
cpython-6b06f29d095e5c99a8b495f23baff8244c624253.tar.gz
cpython-6b06f29d095e5c99a8b495f23baff8244c624253.tar.bz2
Merge Py Idle changes:
Rev 1.5 doerwalter string methods
-rw-r--r--Lib/idlelib/IdleHistory.py12
1 files changed, 5 insertions, 7 deletions
diff --git a/Lib/idlelib/IdleHistory.py b/Lib/idlelib/IdleHistory.py
index b882c92..46e70e1 100644
--- a/Lib/idlelib/IdleHistory.py
+++ b/Lib/idlelib/IdleHistory.py
@@ -1,5 +1,3 @@
-import string
-
class History:
def __init__(self, text, output_sep = "\n"):
@@ -22,11 +20,11 @@ class History:
def _get_source(self, start, end):
# Get source code from start index to end index. Lines in the
# text control may be separated by sys.ps2 .
- lines = string.split(self.text.get(start, end), self.output_sep)
- return string.join(lines, "\n")
+ lines = self.text.get(start, end).split(self.output_sep)
+ return "\n".join(lines)
def _put_source(self, where, source):
- output = string.join(string.split(source, "\n"), self.output_sep)
+ output = self.output_sep.join(source.split("\n"))
self.text.insert(where, output)
def history_do(self, reverse):
@@ -68,7 +66,7 @@ class History:
self.history_prefix = prefix
def history_store(self, source):
- source = string.strip(source)
+ source = source.strip()
if len(source) > 2:
# avoid duplicates
try:
@@ -80,7 +78,7 @@ class History:
self.history_prefix = None
def recall(self, s):
- s = string.strip(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")