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
95d95552
Commit
95d95552
authored
Jun 21, 2016
by
Benjamin Peterson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix idle about dialog #27365
parent
0ffd26f7
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
64 additions
and
1 deletion
+64
-1
Lib/idlelib/aboutDialog.py
Lib/idlelib/aboutDialog.py
+3
-1
Lib/idlelib/idle_test/test_helpabout.py
Lib/idlelib/idle_test/test_helpabout.py
+52
-0
Lib/idlelib/textView.py
Lib/idlelib/textView.py
+4
-0
Misc/NEWS
Misc/NEWS
+5
-0
No files found.
Lib/idlelib/aboutDialog.py
View file @
95d95552
...
...
@@ -129,7 +129,7 @@ class AboutDialog(Toplevel):
self
.
display_file_text
(
'About - Readme'
,
'README.txt'
,
'ascii'
)
def
ShowIDLENEWS
(
self
):
self
.
display_file_text
(
'About - NEWS'
,
'NEWS.txt'
,
'
ascii
'
)
self
.
display_file_text
(
'About - NEWS'
,
'NEWS.txt'
,
'
utf-8
'
)
def
display_printer_text
(
self
,
title
,
printer
):
printer
.
_Printer__setup
()
...
...
@@ -144,5 +144,7 @@ class AboutDialog(Toplevel):
self
.
destroy
()
if
__name__
==
'__main__'
:
import
unittest
unittest
.
main
(
'idlelib.idle_test.test_helpabout'
,
verbosity
=
2
,
exit
=
False
)
from
idlelib.idle_test.htest
import
run
run
(
AboutDialog
)
Lib/idlelib/idle_test/test_helpabout.py
0 → 100644
View file @
95d95552
'''Test idlelib.help_about.
Coverage:
'''
from
idlelib
import
aboutDialog
as
help_about
from
idlelib
import
textView
as
textview
from
idlelib.idle_test.mock_idle
import
Func
from
idlelib.idle_test.mock_tk
import
Mbox
import
unittest
About
=
help_about
.
AboutDialog
class
Dummy_about_dialog
():
# Dummy class for testing file display functions.
idle_credits
=
About
.
ShowIDLECredits
.
im_func
idle_readme
=
About
.
ShowIDLEAbout
.
im_func
idle_news
=
About
.
ShowIDLENEWS
.
im_func
# Called by the above
display_file_text
=
About
.
display_file_text
.
im_func
class
DisplayFileTest
(
unittest
.
TestCase
):
"Test that .txt files are found and properly decoded."
dialog
=
Dummy_about_dialog
()
@
classmethod
def
setUpClass
(
cls
):
cls
.
orig_mbox
=
textview
.
tkMessageBox
cls
.
orig_view
=
textview
.
view_text
cls
.
mbox
=
Mbox
()
cls
.
view
=
Func
()
textview
.
tkMessageBox
=
cls
.
mbox
textview
.
view_text
=
cls
.
view
cls
.
About
=
Dummy_about_dialog
()
@
classmethod
def
tearDownClass
(
cls
):
textview
.
tkMessageBox
=
cls
.
orig_mbox
textview
.
view_text
=
cls
.
orig_view
.
im_func
def
test_file_isplay
(
self
):
for
handler
in
(
self
.
dialog
.
idle_credits
,
self
.
dialog
.
idle_readme
,
self
.
dialog
.
idle_news
):
self
.
mbox
.
showerror
.
message
=
''
self
.
view
.
called
=
False
handler
()
self
.
assertEqual
(
self
.
mbox
.
showerror
.
message
,
''
)
self
.
assertEqual
(
self
.
view
.
called
,
True
)
if
__name__
==
'__main__'
:
unittest
.
main
(
verbosity
=
2
)
Lib/idlelib/textView.py
View file @
95d95552
...
...
@@ -79,6 +79,10 @@ def view_file(parent, title, filename, encoding=None, modal=True):
tkMessageBox
.
showerror
(
title
=
'File Load Error'
,
message
=
'Unable to load file %r .'
%
filename
,
parent
=
parent
)
except
UnicodeDecodeError
as
err
:
showerror
(
title
=
'Unicode Decode Error'
,
message
=
str
(
err
),
parent
=
parent
)
else
:
return
view_text
(
parent
,
title
,
textFile
.
read
(),
modal
)
...
...
Misc/NEWS
View file @
95d95552
...
...
@@ -10,6 +10,11 @@ Build
- Issue #26930: Update Windows builds to use OpenSSL 1.0.2h.
IDLE
----
- Issue #27365: Fix about dialog.
What'
s
New
in
Python
2.7.12
release
candidate
1
?
================================================
...
...
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