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
d183767c
Kaydet (Commit)
d183767c
authored
Kas 01, 2012
tarafından
Andrew Svetlov
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #1207589: Add Cut/Copy/Paste items to IDLE right click Context Menu
Patch by Todd Rovito.
üst
5bb42076
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
98 additions
and
13 deletions
+98
-13
idle.rst
Doc/library/idle.rst
+21
-0
EditorWindow.py
Lib/idlelib/EditorWindow.py
+36
-7
OutputWindow.py
Lib/idlelib/OutputWindow.py
+5
-1
PyShell.py
Lib/idlelib/PyShell.py
+21
-2
help.txt
Lib/idlelib/help.txt
+12
-3
NEWS
Misc/NEWS
+3
-0
No files found.
Doc/library/idle.rst
Dosyayı görüntüle @
d183767c
...
@@ -183,6 +183,15 @@ Edit context menu
...
@@ -183,6 +183,15 @@ Edit context menu
* Right-click in Edit window (Control-click on OS X)
* Right-click in Edit window (Control-click on OS X)
Cut
Copy selection into system-wide clipboard; then delete selection
Copy
Copy selection into system-wide clipboard
Paste
Insert system-wide clipboard into window
Set Breakpoint
Set Breakpoint
Sets a breakpoint. Breakpoints are only enabled when the debugger is open.
Sets a breakpoint. Breakpoints are only enabled when the debugger is open.
...
@@ -190,6 +199,9 @@ Clear Breakpoint
...
@@ -190,6 +199,9 @@ Clear Breakpoint
Clears the breakpoint on that line.
Clears the breakpoint on that line.
.. index::
.. index::
single: Cut
single: Copy
single: Paste
single: Set Breakpoint
single: Set Breakpoint
single: Clear Breakpoint
single: Clear Breakpoint
single: breakpoints
single: breakpoints
...
@@ -200,6 +212,15 @@ Shell context menu
...
@@ -200,6 +212,15 @@ Shell context menu
* Right-click in Python Shell window (Control-click on OS X)
* Right-click in Python Shell window (Control-click on OS X)
Cut
Copy selection into system-wide clipboard; then delete selection
Copy
Copy selection into system-wide clipboard
Paste
Insert system-wide clipboard into window
Go to file/line
Go to file/line
Same as in Debug menu.
Same as in Debug menu.
...
...
Lib/idlelib/EditorWindow.py
Dosyayı görüntüle @
d183767c
...
@@ -464,7 +464,6 @@ class EditorWindow(object):
...
@@ -464,7 +464,6 @@ class EditorWindow(object):
rmenu
=
None
rmenu
=
None
def
right_menu_event
(
self
,
event
):
def
right_menu_event
(
self
,
event
):
self
.
text
.
tag_remove
(
"sel"
,
"1.0"
,
"end"
)
self
.
text
.
mark_set
(
"insert"
,
"@
%
d,
%
d"
%
(
event
.
x
,
event
.
y
))
self
.
text
.
mark_set
(
"insert"
,
"@
%
d,
%
d"
%
(
event
.
x
,
event
.
y
))
if
not
self
.
rmenu
:
if
not
self
.
rmenu
:
self
.
make_rmenu
()
self
.
make_rmenu
()
...
@@ -473,23 +472,53 @@ class EditorWindow(object):
...
@@ -473,23 +472,53 @@ class EditorWindow(object):
iswin
=
sys
.
platform
[:
3
]
==
'win'
iswin
=
sys
.
platform
[:
3
]
==
'win'
if
iswin
:
if
iswin
:
self
.
text
.
config
(
cursor
=
"arrow"
)
self
.
text
.
config
(
cursor
=
"arrow"
)
for
label
,
eventname
,
verify_state
in
self
.
rmenu_specs
:
if
verify_state
is
None
:
continue
state
=
getattr
(
self
,
verify_state
)()
rmenu
.
entryconfigure
(
label
,
state
=
state
)
rmenu
.
tk_popup
(
event
.
x_root
,
event
.
y_root
)
rmenu
.
tk_popup
(
event
.
x_root
,
event
.
y_root
)
if
iswin
:
if
iswin
:
self
.
text
.
config
(
cursor
=
"ibeam"
)
self
.
text
.
config
(
cursor
=
"ibeam"
)
rmenu_specs
=
[
rmenu_specs
=
[
# ("Label", "<<virtual-event>>"), ...
# ("Label", "<<virtual-event>>"
, "statefuncname"
), ...
(
"Close"
,
"<<close-window>>"
),
# Example
(
"Close"
,
"<<close-window>>"
,
None
),
# Example
]
]
def
make_rmenu
(
self
):
def
make_rmenu
(
self
):
rmenu
=
Menu
(
self
.
text
,
tearoff
=
0
)
rmenu
=
Menu
(
self
.
text
,
tearoff
=
0
)
for
label
,
eventname
in
self
.
rmenu_specs
:
for
label
,
eventname
,
_
in
self
.
rmenu_specs
:
def
command
(
text
=
self
.
text
,
eventname
=
eventname
):
if
label
is
not
None
:
text
.
event_generate
(
eventname
)
def
command
(
text
=
self
.
text
,
eventname
=
eventname
):
rmenu
.
add_command
(
label
=
label
,
command
=
command
)
text
.
event_generate
(
eventname
)
rmenu
.
add_command
(
label
=
label
,
command
=
command
)
else
:
rmenu
.
add_separator
()
self
.
rmenu
=
rmenu
self
.
rmenu
=
rmenu
def
rmenu_check_cut
(
self
):
return
self
.
rmenu_check_copy
()
def
rmenu_check_copy
(
self
):
try
:
indx
=
self
.
text
.
index
(
'sel.first'
)
except
TclError
:
return
'disabled'
else
:
return
'normal'
if
indx
else
'disabled'
def
rmenu_check_paste
(
self
):
try
:
self
.
text
.
tk
.
call
(
'tk::GetSelection'
,
self
.
text
,
'CLIPBOARD'
)
except
TclError
:
return
'disabled'
else
:
return
'normal'
def
about_dialog
(
self
,
event
=
None
):
def
about_dialog
(
self
,
event
=
None
):
aboutDialog
.
AboutDialog
(
self
.
top
,
'About IDLE'
)
aboutDialog
.
AboutDialog
(
self
.
top
,
'About IDLE'
)
...
...
Lib/idlelib/OutputWindow.py
Dosyayı görüntüle @
d183767c
...
@@ -52,7 +52,11 @@ class OutputWindow(EditorWindow):
...
@@ -52,7 +52,11 @@ class OutputWindow(EditorWindow):
# Our own right-button menu
# Our own right-button menu
rmenu_specs
=
[
rmenu_specs
=
[
(
"Go to file/line"
,
"<<goto-file-line>>"
),
(
"Cut"
,
"<<cut>>"
,
"rmenu_check_cut"
),
(
"Copy"
,
"<<copy>>"
,
"rmenu_check_copy"
),
(
"Paste"
,
"<<paste>>"
,
"rmenu_check_paste"
),
(
None
,
None
,
None
),
(
"Go to file/line"
,
"<<goto-file-line>>"
,
None
),
]
]
file_line_pats
=
[
file_line_pats
=
[
...
...
Lib/idlelib/PyShell.py
Dosyayı görüntüle @
d183767c
...
@@ -117,8 +117,14 @@ class PyShellEditorWindow(EditorWindow):
...
@@ -117,8 +117,14 @@ class PyShellEditorWindow(EditorWindow):
old_hook
()
old_hook
()
self
.
io
.
set_filename_change_hook
(
filename_changed_hook
)
self
.
io
.
set_filename_change_hook
(
filename_changed_hook
)
rmenu_specs
=
[(
"Set Breakpoint"
,
"<<set-breakpoint-here>>"
),
rmenu_specs
=
[
(
"Clear Breakpoint"
,
"<<clear-breakpoint-here>>"
)]
(
"Cut"
,
"<<cut>>"
,
"rmenu_check_cut"
),
(
"Copy"
,
"<<copy>>"
,
"rmenu_check_copy"
),
(
"Paste"
,
"<<paste>>"
,
"rmenu_check_paste"
),
(
None
,
None
,
None
),
(
"Set Breakpoint"
,
"<<set-breakpoint-here>>"
,
None
),
(
"Clear Breakpoint"
,
"<<clear-breakpoint-here>>"
,
None
)
]
def
set_breakpoint
(
self
,
lineno
):
def
set_breakpoint
(
self
,
lineno
):
text
=
self
.
text
text
=
self
.
text
...
@@ -1240,6 +1246,19 @@ class PyShell(OutputWindow):
...
@@ -1240,6 +1246,19 @@ class PyShell(OutputWindow):
raise
KeyboardInterrupt
raise
KeyboardInterrupt
return
count
return
count
def
rmenu_check_cut
(
self
):
try
:
if
self
.
text
.
compare
(
'sel.first'
,
'<'
,
'iomark'
):
return
'disabled'
except
TclError
:
# no selection, so the index 'sel.first' doesn't exist
return
'disabled'
return
super
()
.
rmenu_check_cut
()
def
rmenu_check_paste
(
self
):
if
self
.
text
.
compare
(
'insert'
,
'<'
,
'iomark'
):
return
'disabled'
return
super
()
.
rmenu_check_paste
()
class
PseudoFile
(
object
):
class
PseudoFile
(
object
):
def
__init__
(
self
,
shell
,
tags
,
encoding
=
None
):
def
__init__
(
self
,
shell
,
tags
,
encoding
=
None
):
...
...
Lib/idlelib/help.txt
Dosyayı görüntüle @
d183767c
...
@@ -120,14 +120,23 @@ Help Menu:
...
@@ -120,14 +120,23 @@ Help Menu:
---
---
(Additional Help Sources may be added here)
(Additional Help Sources may be added here)
Edit context menu (Right-click / Control-click in Edit window):
Edit context menu (Right-click / Control-click
on OS X
in Edit window):
Cut -- Copy a selection into system-wide clipboard,
then delete the selection
Copy -- Copy selection into system-wide clipboard
Paste -- Insert system-wide clipboard into window
Set Breakpoint -- Sets a breakpoint (when debugger open)
Set Breakpoint -- Sets a breakpoint (when debugger open)
Clear Breakpoint -- Clears the breakpoint on that line
Clear Breakpoint -- Clears the breakpoint on that line
Shell context menu (Right-click / Control-click in Shell window):
Shell context menu (Right-click / Control-click
on OS X
in Shell window):
Go to file/line -- Same as in Debug menu
Cut -- Copy a selection into system-wide clipboard,
then delete the selection
Copy -- Copy selection into system-wide clipboard
Paste -- Insert system-wide clipboard into window
---
Go to file/line -- Same as in Debug menu
** TIPS **
** TIPS **
...
...
Misc/NEWS
Dosyayı görüntüle @
d183767c
...
@@ -143,6 +143,9 @@ Core and Builtins
...
@@ -143,6 +143,9 @@ Core and Builtins
Library
Library
-------
-------
- Issue #1207589: Add Cut/Copy/Paste items to IDLE right click Context Menu
Patch by Todd Rovito.
- Issue #16230: Fix a crash in select.select() when one the lists changes
- Issue #16230: Fix a crash in select.select() when one the lists changes
size while iterated on. Patch by Serhiy Storchaka.
size while iterated on. Patch by Serhiy Storchaka.
...
...
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