MCPcopy Index your code
hub / github.com/python/cpython / do_find

Method do_find

Lib/idlelib/replace.py:178–196  ·  view source on GitHub ↗

Search for and highlight next occurrence of pattern in text. No text replacement is done with this option.

(self, ok=False)

Source from the content-addressed store, hash-verified

176 self.close()
177
178 def do_find(self, ok=False):
179 """Search for and highlight next occurrence of pattern in text.
180
181 No text replacement is done with this option.
182 """
183 if not self.engine.getprog():
184 return False
185 text = self.text
186 res = self.engine.search_text(text, None, ok)
187 if not res:
188 self.bell()
189 return False
190 line, m = res
191 i, j = m.span()
192 first = "%d.%d" % (line, i)
193 last = "%d.%d" % (line, j)
194 self.show_hit(first, last)
195 self.ok = True
196 return True
197
198 def do_replace(self):
199 "Replace search pattern in text with replacement value."

Callers 3

find_itMethod · 0.95
replace_itMethod · 0.95
default_commandMethod · 0.95

Calls 4

show_hitMethod · 0.95
getprogMethod · 0.80
search_textMethod · 0.80
bellMethod · 0.45

Tested by

no test coverage detected