Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
9a99ce81
Commit
9a99ce81
authored
May 19, 2014
by
Terry Jan Reedy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #21477: idle htests - lower case function names, other cleanups.
parent
8dfce837
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
27 deletions
+26
-27
Lib/idlelib/EditorWindow.py
Lib/idlelib/EditorWindow.py
+7
-7
Lib/idlelib/idle_test/htest.py
Lib/idlelib/idle_test/htest.py
+19
-20
No files found.
Lib/idlelib/EditorWindow.py
View file @
9a99ce81
...
...
@@ -79,7 +79,7 @@ class HelpDialog(object):
self
.
parent
=
None
helpDialog
=
HelpDialog
()
# singleton instance
def
_
H
elp_dialog
(
parent
):
# wrapper for htest
def
_
h
elp_dialog
(
parent
):
# wrapper for htest
helpDialog
.
show_dialog
(
parent
)
...
...
@@ -1702,21 +1702,21 @@ def fixwordbreaks(root):
tk
.
call
(
'set'
,
'tcl_nonwordchars'
,
'[^a-zA-Z0-9_]'
)
def
_
E
ditor_window
(
parent
):
def
_
e
ditor_window
(
parent
):
root
=
parent
fixwordbreaks
(
root
)
root
.
withdraw
()
##
root.withdraw()
if
sys
.
argv
[
1
:]:
filename
=
sys
.
argv
[
1
]
else
:
filename
=
None
macosxSupport
.
setupApp
(
root
,
None
)
edit
=
EditorWindow
(
root
=
root
,
filename
=
filename
)
edit
.
set_close_hook
(
root
.
quit
)
edit
.
text
.
bind
(
"<<close-all-windows>>"
,
edit
.
close_event
)
##
edit.set_close_hook(root.quit)
##
edit.text.bind("<<close-all-windows>>", edit.close_event)
if
__name__
==
'__main__'
:
from
idlelib.idle_test.htest
import
run
if
len
(
sys
.
argv
)
<=
1
:
run
(
_
H
elp_dialog
)
run
(
_
E
ditor_window
)
run
(
_
h
elp_dialog
)
run
(
_
e
ditor_window
)
Lib/idlelib/idle_test/htest.py
View file @
9a99ce81
...
...
@@ -13,10 +13,10 @@ if __name__ == '__main__':
The X object must have a .__name__ attribute and a 'parent' parameter.
X will often be a widget class, but a callable instance with .__name__
or a wrapper function also work. The name of wrapper functions, like
'_
E
ditor_Window', should start with '_'.
'_
e
ditor_Window', should start with '_'.
This file must contain a matching instance of the folling template,
with X.__name__ prepended, as in '_
E
ditor_window_spec ...'.
with X.__name__ prepended, as in '_
e
ditor_window_spec ...'.
_spec = {
'file': '',
...
...
@@ -33,19 +33,6 @@ msg: displayed in a master window. Hints as to how the user might
from
importlib
import
import_module
import
tkinter
as
tk
_Editor_window_spec
=
{
'file'
:
'EditorWindow'
,
'kwds'
:
{},
'msg'
:
"Test editor functions of interest"
}
_Help_dialog_spec
=
{
'file'
:
'EditorWindow'
,
'kwds'
:
{},
'msg'
:
"If the help text displays, this works"
}
AboutDialog_spec
=
{
'file'
:
'aboutDialog'
,
'kwds'
:
{
'title'
:
'About test'
},
...
...
@@ -53,6 +40,12 @@ AboutDialog_spec = {
}
_editor_window_spec
=
{
'file'
:
'EditorWindow'
,
'kwds'
:
{},
'msg'
:
"Test editor functions of interest"
}
GetCfgSectionNameDialog_spec
=
{
'file'
:
'configSectionNameDialog'
,
'kwds'
:
{
'title'
:
'Get Name'
,
...
...
@@ -64,6 +57,12 @@ GetCfgSectionNameDialog_spec = {
"Close 'Get Name' with a valid entry (printed to Shell), [Cancel], or [X]"
,
}
_help_dialog_spec
=
{
'file'
:
'EditorWindow'
,
'kwds'
:
{},
'msg'
:
"If the help text displays, this works"
}
def
run
(
test
):
"Display a widget with callable *test* using a _spec dict"
root
=
tk
.
Tk
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment