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

Function grep

Lib/idlelib/grep.py:20–40  ·  view source on GitHub ↗

Open the Find in Files dialog. Module-level function to access the singleton GrepDialog instance and open the dialog. If text is selected, it is used as the search phrase; otherwise, the previous entry is used. Args: text: Text widget that contains the selected text fo

(text, io=None, flist=None)

Source from the content-addressed store, hash-verified

18
19
20def grep(text, io=None, flist=None):
21 """Open the Find in Files dialog.
22
23 Module-level function to access the singleton GrepDialog
24 instance and open the dialog. If text is selected, it is
25 used as the search phrase; otherwise, the previous entry
26 is used.
27
28 Args:
29 text: Text widget that contains the selected text for
30 default search phrase.
31 io: iomenu.IOBinding instance with default path to search.
32 flist: filelist.FileList instance for OutputWindow parent.
33 """
34 root = text._root()
35 engine = searchengine.get(root)
36 if not hasattr(engine, "_grepdialog"):
37 engine._grepdialog = GrepDialog(root, engine, flist)
38 dialog = engine._grepdialog
39 searchphrase = text.get("sel.first", "sel.last")
40 dialog.open(text, searchphrase, io)
41
42
43def walk_error(msg):

Callers 1

show_grep_dialogFunction · 0.85

Calls 4

GrepDialogClass · 0.85
_rootMethod · 0.80
getMethod · 0.45
openMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…