diff options
author | Kurt B. Kaiser <kbk@shore.net> | 2002-09-18 02:56:10 (GMT) |
---|---|---|
committer | Kurt B. Kaiser <kbk@shore.net> | 2002-09-18 02:56:10 (GMT) |
commit | ce86b10eb8121481e2d59230d044d61c28243aeb (patch) | |
tree | 9127f33bd81dfe7a195f7f10a6eec3776efba0c2 /Lib/idlelib | |
parent | 837d15c5b5deee769079faa94117d8a83adb53ec (diff) | |
download | cpython-ce86b10eb8121481e2d59230d044d61c28243aeb.zip cpython-ce86b10eb8121481e2d59230d044d61c28243aeb.tar.gz cpython-ce86b10eb8121481e2d59230d044d61c28243aeb.tar.bz2 |
Merge Py Idle changes:
Rev 1.5 tim_one
Convert a pile of obvious "yes/no" functions to return bool
Rev 1.6 GvR
Rev 1.7 Gvr
(Already merged Idlefork ReplaceDialog.py 1.3.2.1 and 1.4)
Rev 1.8 doerwalter
(string methods)
Rev 1.9 nnorwitz
Remove unnecessary imports
Diffstat (limited to 'Lib/idlelib')
-rw-r--r-- | Lib/idlelib/ReplaceDialog.py | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/Lib/idlelib/ReplaceDialog.py b/Lib/idlelib/ReplaceDialog.py index 1b6cbce..c8eb1c8 100644 --- a/Lib/idlelib/ReplaceDialog.py +++ b/Lib/idlelib/ReplaceDialog.py @@ -1,9 +1,4 @@ -import string -import os -import re -import fnmatch from Tkinter import * -import tkMessageBox import SearchEngine from SearchDialogBase import SearchDialogBase @@ -111,24 +106,24 @@ class ReplaceDialog(SearchDialogBase): def do_find(self, ok=0): if not self.engine.getprog(): - return 0 + return False text = self.text res = self.engine.search_text(text, None, ok) if not res: text.bell() - return 0 + return False line, m = res i, j = m.span() first = "%d.%d" % (line, i) last = "%d.%d" % (line, j) self.show_hit(first, last) self.ok = 1 - return 1 + return True def do_replace(self): prog = self.engine.getprog() if not prog: - return 0 + return False text = self.text try: first = pos = text.index("sel.first") @@ -141,7 +136,7 @@ class ReplaceDialog(SearchDialogBase): chars = text.get("%d.0" % line, "%d.0" % (line+1)) m = prog.match(chars, col) if not prog: - return 0 + return False new = m.expand(self.replvar.get()) text.mark_set("insert", first) text.undo_block_start() @@ -152,7 +147,7 @@ class ReplaceDialog(SearchDialogBase): text.undo_block_stop() self.show_hit(first, text.index("insert")) self.ok = 0 - return 1 + return True def show_hit(self, first, last): text = self.text |