Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions Lib/idlelib/README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -67,22 +67,23 @@ pyparse.py # Give information on code indentation
pyshell.py # Start IDLE, manage shell, complete editor window
query.py # Query user for information
redirector.py # Intercept widget subcommands (for percolator) (nim).
replace.py # Search and replace pattern in text.
rpc.py # Commuicate between idle and user processes (nim).
rstrip.py # Strip trailing whitespace.
run.py # Manage user code execution subprocess.
runscript.py # Check and run user code.
scrolledlist.py # Define scrolledlist widget for IDLE (nim).
search.py # Search for pattern in text.
searchbar.py # Search for pattern in text.
searchbase.py # Define base for search, replace, and grep dialogs.
searchengine.py # Define engine for all 3 search dialogs.
squeezer.py # "Squeeze" shell outputs and errors.
stackviewer.py # View stack after exception.
statusbar.py # Define status bar for windows (nim).
tabbedpages.py # Define tabbed pages widget (nim).
textview.py # Define read-only text widget (nim).
tree.py # Define tree widger, used in browsers (nim).
undo.py # Manage undo stack.
windows.py # Manage window list and define listed top level.
windowsearchengine.py # Per-window search engine.
zoomheight.py # Zoom window to full height of screen.

Configuration
Expand Down Expand Up @@ -148,11 +149,11 @@ Edit
Paste # eEW.past
Select All # eEW.select_all (+ see eEW.remove_selection)
--- # Next 5 items use searchengine; dialogs use searchbase
Find # eEW.find_event, search.SearchDialog.find
Find Again # eEW.find_again_event, sSD.find_again
Find Selection # eEW.find_selection_event, sSD.find_selection
Find # searchbar.FindBar.show_event
Find Again # searchbar.FindBar.search_again_event
Find Selection # searchbar.FindBar.search_selection_event
Find in Files... # eEW.find_in_files_event, grep
Replace... # eEW.replace_event, replace.ReplaceDialog.replace
Replace... # searchbar.ReplaceBar.show_event
Go to Line # eEW.goto_line_event
Show Completions # autocomplete extension and autocompleteWidow (&HP)
Expand Word # autoexpand extension
Expand Down
3 changes: 3 additions & 0 deletions Lib/idlelib/config-main.def
Original file line number Diff line number Diff line change
Expand Up @@ -89,3 +89,6 @@ name2=
cyclic=1

[HelpFiles]

[Search]
is-incremental= 1
28 changes: 27 additions & 1 deletion Lib/idlelib/configdialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,13 @@
from idlelib.codecontext import CodeContext
from idlelib.parenmatch import ParenMatch
from idlelib.paragraph import FormatParagraph
from idlelib.searchbar import SearchBar
from idlelib.squeezer import Squeezer

changes = ConfigChanges()
# Reload changed options in the following classes.
reloadables = (AutoComplete, CodeContext, ParenMatch, FormatParagraph,
Squeezer)
SearchBar, Squeezer)


class ConfigDialog(Toplevel):
Expand Down Expand Up @@ -1819,6 +1820,9 @@ def create_page_general(self):
frame_context: Frame
context_title: Label
(*)context_int: Entry - context_lines
frame_search: LabelFrame
frame_incremental_search: Frame
(*)incremental_search_on: Checkbutton - incremental_search
frame_shell: LabelFrame
frame_auto_squeeze_min_lines: Frame
auto_squeeze_min_lines_title: Label
Expand Down Expand Up @@ -1848,6 +1852,9 @@ def create_page_general(self):
self.paren_bell = tracers.add(
BooleanVar(self), ('extensions', 'ParenMatch', 'bell'))

self.incremental_search = tracers.add(
BooleanVar(self), ('main', 'Search', 'is-incremental'))

self.auto_squeeze_min_lines = tracers.add(
StringVar(self), ('main', 'PyShell', 'auto-squeeze-min-lines'))

Expand All @@ -1864,6 +1871,8 @@ def create_page_general(self):
text=' Window Preferences')
frame_editor = LabelFrame(self, borderwidth=2, relief=GROOVE,
text=' Editor Preferences')
frame_search = LabelFrame(self, borderwidth=2, relief=GROOVE,
text=' Search Preferences')
frame_shell = LabelFrame(self, borderwidth=2, relief=GROOVE,
text=' Shell Preferences')
frame_help = LabelFrame(self, borderwidth=2, relief=GROOVE,
Expand Down Expand Up @@ -1929,6 +1938,14 @@ def create_page_general(self):
self.context_int = Entry(
frame_context, textvariable=self.context_lines, width=3)

# Frame_search.
frame_incremental_search = Frame(frame_search, borderwidth=0)
self.incremental_search_on = Checkbutton(
frame_incremental_search,
text='Incremental Search (as-you-type)',
variable=self.incremental_search,
)

# Frame_shell.
frame_auto_squeeze_min_lines = Frame(frame_shell, borderwidth=0)
auto_squeeze_min_lines_title = Label(frame_auto_squeeze_min_lines,
Expand Down Expand Up @@ -1961,6 +1978,7 @@ def create_page_general(self):
# Body.
frame_window.pack(side=TOP, padx=5, pady=5, expand=TRUE, fill=BOTH)
frame_editor.pack(side=TOP, padx=5, pady=5, expand=TRUE, fill=BOTH)
frame_search.pack(side=TOP, padx=5, pady=5, expand=TRUE, fill=BOTH)
frame_shell.pack(side=TOP, padx=5, pady=5, expand=TRUE, fill=BOTH)
frame_help.pack(side=TOP, padx=5, pady=5, expand=TRUE, fill=BOTH)
# frame_run.
Expand Down Expand Up @@ -2002,6 +2020,10 @@ def create_page_general(self):
context_title.pack(side=LEFT, anchor=W, padx=5, pady=5)
self.context_int.pack(side=TOP, padx=5, pady=5)

# frame_incremental_search
frame_incremental_search.pack(side=TOP, padx=5, pady=0, fill=X)
self.incremental_search_on.pack(side=LEFT, padx=5, pady=5)

# frame_auto_squeeze_min_lines
frame_auto_squeeze_min_lines.pack(side=TOP, padx=5, pady=0, fill=X)
auto_squeeze_min_lines_title.pack(side=LEFT, anchor=W, padx=5, pady=5)
Expand Down Expand Up @@ -2042,6 +2064,10 @@ def load_general_cfg(self):
self.context_lines.set(idleConf.GetOption(
'extensions', 'CodeContext', 'maxlines', type='int'))

# Set variables for search.
self.incremental_search.set(idleConf.GetOption(
'main', 'Search', 'is-incremental', type='bool'))

# Set variables for shell windows.
self.auto_squeeze_min_lines.set(idleConf.GetOption(
'main', 'PyShell', 'auto-squeeze-min-lines', type='int'))
Expand Down
28 changes: 6 additions & 22 deletions Lib/idlelib/editor.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@
from idlelib.multicall import MultiCallCreator
from idlelib import pyparse
from idlelib import query
from idlelib import replace
from idlelib import search
from idlelib import window

# The default tab setting for a Text widget, in average-width characters.
Expand Down Expand Up @@ -56,6 +54,7 @@ class EditorWindow(object):
from idlelib.paragraph import FormatParagraph
from idlelib.parenmatch import ParenMatch
from idlelib.rstrip import Rstrip
from idlelib.searchbar import SearchBar
from idlelib.squeezer import Squeezer
from idlelib.zoomheight import ZoomHeight

Expand Down Expand Up @@ -161,11 +160,7 @@ def __init__(self, flist=None, filename=None, key=None, root=None):
text.bind("<<do-nothing>>", lambda event: "break")
text.bind("<<select-all>>", self.select_all)
text.bind("<<remove-selection>>", self.remove_selection)
text.bind("<<find>>", self.find_event)
text.bind("<<find-again>>", self.find_again_event)
text.bind("<<find-in-files>>", self.find_in_files_event)
text.bind("<<find-selection>>", self.find_selection_event)
text.bind("<<replace>>", self.replace_event)
text.bind("<<goto-line>>", self.goto_line_event)
text.bind("<<smart-backspace>>",self.smart_backspace_event)
text.bind("<<newline-and-indent>>",self.newline_and_indent_event)
Expand Down Expand Up @@ -317,6 +312,11 @@ def __init__(self, flist=None, filename=None, key=None, root=None):
text.bind("<<zoom-height>>", self.ZoomHeight(self).zoom_height_event)
text.bind("<<toggle-code-context>>",
self.CodeContext(self).toggle_code_context_event)
searchbar = self.SearchBar(self)
text.bind("<<find>>", searchbar.search_event)
text.bind("<<find-again>>", searchbar.search_again_event)
text.bind("<<find-selection>>", searchbar.search_selection_event)
text.bind("<<replace>>", searchbar.replace_event)
squeezer = self.Squeezer(self)
text.bind("<<squeeze-current-text>>",
squeezer.squeeze_current_text_event)
Expand Down Expand Up @@ -627,26 +627,10 @@ def del_word_right(self, event):
self.text.event_generate('<Meta-d>')
return "break"

def find_event(self, event):
search.find(self.text)
return "break"

def find_again_event(self, event):
search.find_again(self.text)
return "break"

def find_selection_event(self, event):
search.find_selection(self.text)
return "break"

def find_in_files_event(self, event):
grep.grep(self.text, self.io, self.flist)
return "break"

def replace_event(self, event):
replace.replace(self.text)
return "break"

def goto_line_event(self, event):
text = self.text
lineno = tkSimpleDialog.askinteger("Goto",
Expand Down
23 changes: 0 additions & 23 deletions Lib/idlelib/idle_test/htest.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,29 +253,6 @@ def _wrapper(parent): # htest #
}


_replace_dialog_spec = {
'file': 'replace',
'kwds': {},
'msg': "Click the 'Replace' button.\n"
"Test various replace options in the 'Replace dialog'.\n"
"Click [Close] or [X] to close the 'Replace Dialog'."
}

_search_dialog_spec = {
'file': 'search',
'kwds': {},
'msg': "Click the 'Search' button.\n"
"Test various search options in the 'Search dialog'.\n"
"Click [Close] or [X] to close the 'Search Dialog'."
}

_searchbase_spec = {
'file': 'searchbase',
'kwds': {},
'msg': "Check the appearance of the base search dialog\n"
"Its only action is to close."
}

_scrolled_list_spec = {
'file': 'scrolledlist',
'kwds': {},
Expand Down
Loading