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
c95e88cd
Commit
c95e88cd
authored
Jul 28, 2014
by
Terry Jan Reedy
Browse files
Options
Browse Files
Download
Plain Diff
Merge with 3.4
parents
6b08235a
7e55db2b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
0 deletions
+30
-0
Lib/idlelib/Bindings.py
Lib/idlelib/Bindings.py
+5
-0
Lib/idlelib/EditorWindow.py
Lib/idlelib/EditorWindow.py
+9
-0
Lib/turtledemo/__main__.py
Lib/turtledemo/__main__.py
+16
-0
No files found.
Lib/idlelib/Bindings.py
View file @
c95e88cd
...
...
@@ -8,6 +8,8 @@ the PythonShell window, and a Format menu which is only present in the Editor
windows.
"""
from
importlib.util
import
find_spec
from
idlelib.configHandler
import
idleConf
# Warning: menudefs is altered in macosxSupport.overrideRootMenu()
...
...
@@ -86,4 +88,7 @@ menudefs = [
]),
]
if
find_spec
(
'turtledemo'
):
menudefs
[
-
1
][
1
].
append
((
'Turtle Demo'
,
'<<open-turtle-demo>>'
))
default_keydefs
=
idleConf
.
GetCurrentKeySet
()
Lib/idlelib/EditorWindow.py
View file @
c95e88cd
...
...
@@ -222,6 +222,7 @@ class EditorWindow(object):
text
.
bind
(
"<<close-all-windows>>"
,
self
.
flist
.
close_all_callback
)
text
.
bind
(
"<<open-class-browser>>"
,
self
.
open_class_browser
)
text
.
bind
(
"<<open-path-browser>>"
,
self
.
open_path_browser
)
text
.
bind
(
"<<open-turtle-demo>>"
,
self
.
open_turtle_demo
)
self
.
set_status_bar
()
vbar
[
'command'
]
=
text
.
yview
...
...
@@ -705,6 +706,14 @@ class EditorWindow(object):
from
idlelib
import
PathBrowser
PathBrowser
.
PathBrowser
(
self
.
flist
)
def
open_turtle_demo
(
self
,
event
=
None
):
import
subprocess
cmd
=
[
sys
.
executable
,
'-c'
,
'from turtledemo.__main__ import main; main()'
]
p
=
subprocess
.
Popen
(
cmd
,
shell
=
False
)
def
gotoline
(
self
,
lineno
):
if
lineno
is
not
None
and
lineno
>
0
:
self
.
text
.
mark_set
(
"insert"
,
"%d.0"
%
lineno
)
...
...
Lib/turtledemo/__main__.py
View file @
c95e88cd
...
...
@@ -112,6 +112,22 @@ class DemoWindow(object):
root
.
title
(
'Python turtle-graphics examples'
)
root
.
wm_protocol
(
"WM_DELETE_WINDOW"
,
self
.
_destroy
)
if
sys
.
platform
==
'darwin'
:
import
subprocess
# Make sure we are the currently activated OS X application
# so that our menu bar appears.
p
=
subprocess
.
Popen
(
[
'osascript'
,
'-e'
,
'tell application "System Events"'
,
'-e'
,
'set frontmost of the first process whose '
'unix id is {} to true'
.
format
(
os
.
getpid
()),
'-e'
,
'end tell'
,
],
stderr
=
subprocess
.
DEVNULL
,
stdout
=
subprocess
.
DEVNULL
,
)
root
.
grid_rowconfigure
(
1
,
weight
=
1
)
root
.
grid_columnconfigure
(
0
,
weight
=
1
)
root
.
grid_columnconfigure
(
1
,
minsize
=
90
,
weight
=
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