Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
827822ef
Kaydet (Commit)
827822ef
authored
Şub 12, 2009
tarafından
Ronald Oussoren
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fix for issue5194, based on a patch by Ned Deily.
üst
de09acf2
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
65 additions
and
15 deletions
+65
-15
Bindings.py
Lib/idlelib/Bindings.py
+2
-1
EditorWindow.py
Lib/idlelib/EditorWindow.py
+1
-1
MultiCall.py
Lib/idlelib/MultiCall.py
+2
-1
keybindingDialog.py
Lib/idlelib/keybindingDialog.py
+2
-1
macosxSupport.py
Lib/idlelib/macosxSupport.py
+6
-2
IDLE
Mac/IDLE/IDLE.app/Contents/MacOS/IDLE
+1
-1
idlemain.py
Mac/IDLE/IDLE.app/Contents/Resources/idlemain.py
+50
-7
Makefile.in
Mac/Makefile.in
+1
-1
No files found.
Lib/idlelib/Bindings.py
Dosyayı görüntüle @
827822ef
...
...
@@ -10,6 +10,7 @@ windows.
"""
import
sys
from
idlelib.configHandler
import
idleConf
from
idlelib
import
macosxSupport
menudefs
=
[
# underscore prefixes character to underscore
...
...
@@ -80,7 +81,7 @@ menudefs = [
]),
]
if
sys
.
platform
==
'darwin'
and
'.app'
in
sys
.
executable
:
if
macosxSupport
.
runningAsOSXApp
()
:
# Running as a proper MacOS application bundle. This block restructures
# the menus a little to make them conform better to the HIG.
...
...
Lib/idlelib/EditorWindow.py
Dosyayı görüntüle @
827822ef
...
...
@@ -363,7 +363,7 @@ class EditorWindow(object):
underline
,
label
=
prepstr
(
label
)
menudict
[
name
]
=
menu
=
Menu
(
mbar
,
name
=
name
)
mbar
.
add_cascade
(
label
=
label
,
menu
=
menu
,
underline
=
underline
)
if
sys
.
platform
==
'darwin'
and
'.framework'
in
sys
.
executable
:
if
macosxSupport
.
runningAsOSXApp
()
:
# Insert the application menu
menudict
[
'application'
]
=
menu
=
Menu
(
mbar
,
name
=
'apple'
)
mbar
.
add_cascade
(
label
=
'IDLE'
,
menu
=
menu
)
...
...
Lib/idlelib/MultiCall.py
Dosyayı görüntüle @
827822ef
...
...
@@ -32,6 +32,7 @@ Each function will be called at most once for each event.
import
sys
import
re
import
tkinter
from
idlelib
import
macosxSupport
# the event type constants, which define the meaning of mc_type
MC_KEYPRESS
=
0
;
MC_KEYRELEASE
=
1
;
MC_BUTTONPRESS
=
2
;
MC_BUTTONRELEASE
=
3
;
...
...
@@ -44,7 +45,7 @@ MC_SHIFT = 1<<0; MC_CONTROL = 1<<2; MC_ALT = 1<<3; MC_META = 1<<5
MC_OPTION
=
1
<<
6
;
MC_COMMAND
=
1
<<
7
# define the list of modifiers, to be used in complex event types.
if
sys
.
platform
==
"darwin"
and
sys
.
executable
.
count
(
".app"
):
if
macosxSupport
.
runningAsOSXApp
(
):
_modifiers
=
((
"Shift"
,),
(
"Control"
,),
(
"Option"
,),
(
"Command"
,))
_modifier_masks
=
(
MC_SHIFT
,
MC_CONTROL
,
MC_OPTION
,
MC_COMMAND
)
else
:
...
...
Lib/idlelib/keybindingDialog.py
Dosyayı görüntüle @
827822ef
...
...
@@ -4,6 +4,7 @@ Dialog for building Tkinter accelerator key bindings
from
tkinter
import
*
import
tkinter.messagebox
as
tkMessageBox
import
string
from
idlelib
import
macosxSupport
class
GetKeysDialog
(
Toplevel
):
def
__init__
(
self
,
parent
,
title
,
action
,
currentKeySequences
):
...
...
@@ -133,7 +134,7 @@ class GetKeysDialog(Toplevel):
config-keys.def must use the same ordering.
"""
import
sys
if
sys
.
platform
==
'darwin'
and
sys
.
argv
[
0
]
.
count
(
'.app'
):
if
macosxSupport
.
runningAsOSXApp
(
):
self
.
modifiers
=
[
'Shift'
,
'Control'
,
'Option'
,
'Command'
]
else
:
self
.
modifiers
=
[
'Control'
,
'Alt'
,
'Shift'
]
...
...
Lib/idlelib/macosxSupport.py
Dosyayı görüntüle @
827822ef
...
...
@@ -6,8 +6,12 @@ import sys
import
tkinter
def
runningAsOSXApp
():
""" Returns True iff running from the IDLE.app bundle on OSX """
return
(
sys
.
platform
==
'darwin'
and
'IDLE.app'
in
sys
.
argv
[
0
])
"""
Returns True if Python is running from within an app on OSX.
If so, assume that Python was built with Aqua Tcl/Tk rather than
X11 Tck/Tk.
"""
return
(
sys
.
platform
==
'darwin'
and
'.app'
in
sys
.
executable
)
def
addOpenEventSupport
(
root
,
flist
):
"""
...
...
Mac/IDLE/IDLE.app/Contents/MacOS/IDLE
Dosyayı görüntüle @
827822ef
#!%prefix%/Resources/Python.app/Contents/MacOS/
Python3
#!%prefix%/Resources/Python.app/Contents/MacOS/
%exe%
import sys, os
execdir = os.path.dirname(sys.argv[0])
...
...
Mac/IDLE/IDLE.app/Contents/Resources/idlemain.py
Dosyayı görüntüle @
827822ef
...
...
@@ -3,8 +3,6 @@ Bootstrap script for IDLE as an application bundle.
"""
import
sys
,
os
from
idlelib.PyShell
import
main
# Change the current directory the user's home directory, that way we'll get
# a more useful default location in the open/save dialogs.
os
.
chdir
(
os
.
path
.
expanduser
(
'~/Documents'
))
...
...
@@ -13,10 +11,54 @@ os.chdir(os.path.expanduser('~/Documents'))
# Make sure sys.executable points to the python interpreter inside the
# framework, instead of at the helper executable inside the application
# bundle (the latter works, but doesn't allow access to the window server)
if
sys
.
executable
.
endswith
(
'-32'
):
sys
.
executable
=
os
.
path
.
join
(
sys
.
prefix
,
'bin'
,
'python-32'
)
else
:
sys
.
executable
=
os
.
path
.
join
(
sys
.
prefix
,
'bin'
,
'python'
)
#
# .../IDLE.app/
# Contents/
# MacOS/
# IDLE (a python script)
# Python{-32} (symlink)
# Resources/
# idlemain.py (this module)
# ...
#
# ../IDLE.app/Contents/MacOS/Python{-32} is symlinked to
# ..Library/Frameworks/Python.framework/Versions/m.n
# /Resources/Python.app/Contents/MacOS/Python{-32}
# which is the Python interpreter executable
#
# The flow of control is as follows:
# 1. IDLE.app is launched which starts python running the IDLE script
# 2. IDLE script exports
# PYTHONEXECUTABLE = .../IDLE.app/Contents/MacOS/Python{-32}
# (the symlink to the framework python)
# 3. IDLE script alters sys.argv and uses os.execve to replace itself with
# idlemain.py running under the symlinked python.
# This is the magic step.
# 4. During interpreter initialization, because PYTHONEXECUTABLE is defined,
# sys.executable may get set to an unuseful value.
#
# (Note that the IDLE script and the setting of PYTHONEXECUTABLE is
# generated automatically by bundlebuilder in the Python 2.x build.
# Also, IDLE invoked via command line, i.e. bin/idle, bypasses all of
# this.)
#
# Now fix up the execution environment before importing idlelib.
# Reset sys.executable to its normal value, the actual path of
# the interpreter in the framework, by following the symlink
# exported in PYTHONEXECUTABLE.
pyex
=
os
.
environ
[
'PYTHONEXECUTABLE'
]
sys
.
executable
=
os
.
path
.
join
(
os
.
path
.
dirname
(
pyex
),
os
.
readlink
(
pyex
))
# Remove any sys.path entries for the Resources dir in the IDLE.app bundle.
p
=
pyex
.
partition
(
'.app'
)
if
p
[
2
]
.
startswith
(
'/Contents/MacOS/Python'
):
sys
.
path
=
[
value
for
value
in
sys
.
path
if
value
.
partition
(
'.app'
)
!=
(
p
[
0
],
p
[
1
],
'/Contents/Resources'
)]
# Unexport PYTHONEXECUTABLE so that the other Python processes started
# by IDLE have a normal sys.executable.
del
os
.
environ
[
'PYTHONEXECUTABLE'
]
# Look for the -psn argument that the launcher adds and remove it, it will
# only confuse the IDLE startup code.
...
...
@@ -25,6 +67,7 @@ for idx, value in enumerate(sys.argv):
del
sys
.
argv
[
idx
]
break
#argvemulator.ArgvCollector().mainloop()
# Now it is safe to import idlelib.
from
idlelib.PyShell
import
main
if
__name__
==
'__main__'
:
main
()
Mac/Makefile.in
Dosyayı görüntüle @
827822ef
...
...
@@ -215,7 +215,7 @@ install_Python4way: install_Python
install_IDLE
:
test
-d
"
$(DESTDIR)$(PYTHONAPPSDIR)
"
||
mkdir
-p
"
$(DESTDIR)$(PYTHONAPPSDIR)
"
-
test
-d
"
$(DESTDIR)$(PYTHONAPPSDIR)
/IDLE.app"
&&
rm
-r
"
$(DESTDIR)$(PYTHONAPPSDIR)
/IDLE.app"
-
test
-d
"
$(DESTDIR)$(PYTHONAPPSDIR)
/IDLE.app"
&&
rm
-r
f
"
$(DESTDIR)$(PYTHONAPPSDIR)
/IDLE.app"
/bin/cp
-PR
"
$(srcdir)
/IDLE/IDLE.app"
"
$(DESTDIR)$(PYTHONAPPSDIR)
"
ln
-sf
$(INSTALLED_PYTHONAPP)
"
$(DESTDIR)$(PYTHONAPPSDIR)
/IDLE.app/Contents/MacOS/Python"
sed
-e
"s!%prefix%!
$(prefix)
!g"
-e
's!%exe%!
$(PYTHONFRAMEWORK)
!g'
<
"
$(srcdir)
/IDLE/IDLE.app/Contents/MacOS/IDLE"
>
"
$(DESTDIR)$(PYTHONAPPSDIR)
/IDLE.app/Contents/MacOS/IDLE"
...
...
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