Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 68a53c5

Browse files
committed
Issue #27380: IDLE: add base Query dialog, with ttk widgets and subclass
SectionName. These split class GetCfgSectionNameDialog from configSectionNameDialog.py, temporarily renamed config_sec.py in 3.7.9a2. More Query subclasses are planned.
1 parent 754a5c1 commit 68a53c5

6 files changed

Lines changed: 326 additions & 188 deletions

File tree

Lib/idlelib/config_sec.py

Lines changed: 0 additions & 98 deletions
This file was deleted.

Lib/idlelib/configdialog.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
from idlelib.config import idleConf
1919
from idlelib.dynoption import DynOptionMenu
2020
from idlelib.config_key import GetKeysDialog
21-
from idlelib.config_sec import GetCfgSectionNameDialog
21+
from idlelib.query import SectionName
2222
from idlelib.config_help import GetHelpSourceDialog
2323
from idlelib.tabbedpages import TabbedPageSet
2424
from idlelib.textview import view_text
@@ -684,7 +684,7 @@ def GetNewKeys(self):
684684
def GetNewKeysName(self, message):
685685
usedNames = (idleConf.GetSectionList('user', 'keys') +
686686
idleConf.GetSectionList('default', 'keys'))
687-
newKeySet = GetCfgSectionNameDialog(
687+
newKeySet = SectionName(
688688
self, 'New Custom Key Set', message, usedNames).result
689689
return newKeySet
690690

@@ -837,7 +837,7 @@ def OnNewColourSet(self):
837837
def GetNewThemeName(self, message):
838838
usedNames = (idleConf.GetSectionList('user', 'highlight') +
839839
idleConf.GetSectionList('default', 'highlight'))
840-
newTheme = GetCfgSectionNameDialog(
840+
newTheme = SectionName(
841841
self, 'New Custom Theme', message, usedNames).result
842842
return newTheme
843843

Lib/idlelib/idle_test/htest.py

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -137,18 +137,6 @@ def _wrapper(parent): # htest #
137137
"Best to close editor first."
138138
}
139139

140-
GetCfgSectionNameDialog_spec = {
141-
'file': 'config_sec',
142-
'kwds': {'title':'Get Name',
143-
'message':'Enter something',
144-
'used_names': {'abc'},
145-
'_htest': True},
146-
'msg': "After the text entered with [Ok] is stripped, <nothing>, "
147-
"'abc', or more that 30 chars are errors.\n"
148-
"Close 'Get Name' with a valid entry (printed to Shell), "
149-
"[Cancel], or [X]",
150-
}
151-
152140
GetHelpSourceDialog_spec = {
153141
'file': 'config_help',
154142
'kwds': {'title': 'Get helpsource',
@@ -245,6 +233,17 @@ def _wrapper(parent): # htest #
245233
"Test for actions like text entry, and removal."
246234
}
247235

236+
Query_spec = {
237+
'file': 'query',
238+
'kwds': {'title':'Query',
239+
'message':'Enter something',
240+
'_htest': True},
241+
'msg': "Enter with <Return> or [Ok]. Print valid entry to Shell\n"
242+
"Blank line, after stripping, is ignored\n"
243+
"Close dialog with valid entry, [Cancel] or [X]",
244+
}
245+
246+
248247
_replace_dialog_spec = {
249248
'file': 'replace',
250249
'kwds': {},

Lib/idlelib/idle_test/test_config_sec.py

Lines changed: 0 additions & 75 deletions
This file was deleted.

0 commit comments

Comments
 (0)