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
9c589469
Commit
9c589469
authored
Jun 22, 2014
by
Terry Jan Reedy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #21824: Turtledemo 2.7 help menu entries now display help text instead
of help file name.
parent
a20ec7e8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
11 deletions
+15
-11
Demo/turtle/turtleDemo.py
Demo/turtle/turtleDemo.py
+15
-11
No files found.
Demo/turtle/turtleDemo.py
View file @
9c589469
...
...
@@ -5,11 +5,17 @@ import os
from
Tkinter
import
*
from
idlelib.Percolator
import
Percolator
from
idlelib.ColorDelegator
import
ColorDelegator
from
idlelib.textView
import
TextViewer
from
idlelib.textView
import
view_file
import
turtle
import
time
demo_dir
=
os
.
getcwd
()
if
"turtleDemo.py"
not
in
os
.
listdir
(
demo_dir
):
print
"Directory of turtleDemo must be current working directory!"
print
"But in your case this is"
,
demo_dir
sys
.
exit
()
STARTUP
=
1
READY
=
2
RUNNING
=
3
...
...
@@ -21,12 +27,7 @@ btnfont = ("Arial", 12, 'bold')
txtfont
=
(
'Lucida Console'
,
8
,
'normal'
)
def
getExampleEntries
():
cwd
=
os
.
getcwd
()
if
"turtleDemo.py"
not
in
os
.
listdir
(
cwd
):
print
"Directory of turtleDemo must be current working directory!"
print
"But in your case this is"
,
cwd
sys
.
exit
()
entries1
=
[
entry
for
entry
in
os
.
listdir
(
cwd
)
if
entries1
=
[
entry
for
entry
in
os
.
listdir
(
demo_dir
)
if
entry
.
startswith
(
"tdemo_"
)
and
not
entry
.
endswith
(
".pyc"
)]
entries2
=
[]
...
...
@@ -34,7 +35,7 @@ def getExampleEntries():
if
entry
.
endswith
(
".py"
):
entries2
.
append
(
entry
)
else
:
path
=
os
.
path
.
join
(
cwd
,
entry
)
path
=
os
.
path
.
join
(
demo_dir
,
entry
)
sys
.
path
.
append
(
path
)
subdir
=
[
entry
]
scripts
=
[
script
for
script
in
os
.
listdir
(
path
)
if
...
...
@@ -44,13 +45,16 @@ def getExampleEntries():
return
entries2
def
showDemoHelp
():
TextViewer
(
demo
.
root
,
"Help on turtleDemo"
,
"demohelp.txt"
)
view_file
(
demo
.
root
,
"Help on turtleDemo"
,
os
.
path
.
join
(
demo_dir
,
"demohelp.txt"
))
def
showAboutDemo
():
TextViewer
(
demo
.
root
,
"About turtleDemo"
,
"about_turtledemo.txt"
)
view_file
(
demo
.
root
,
"About turtleDemo"
,
os
.
path
.
join
(
demo_dir
,
"about_turtledemo.txt"
))
def
showAboutTurtle
():
TextViewer
(
demo
.
root
,
"About the new turtle module"
,
"about_turtle.txt"
)
view_file
(
demo
.
root
,
"About the new turtle module."
,
os
.
path
.
join
(
demo_dir
,
"about_turtle.txt"
))
class
DemoWindow
(
object
):
...
...
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