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
307021f4
Kaydet (Commit)
307021f4
authored
Kas 27, 2005
tarafından
Martin v. Löwis
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Patch #1162825: Support non-ASCII characters in IDLE window titles.
üst
1f663574
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
36 additions
and
6 deletions
+36
-6
EditorWindow.py
Lib/idlelib/EditorWindow.py
+23
-4
IOBinding.py
Lib/idlelib/IOBinding.py
+11
-2
NEWS
Misc/NEWS
+2
-0
No files found.
Lib/idlelib/EditorWindow.py
Dosyayı görüntüle @
307021f4
...
...
@@ -42,7 +42,7 @@ class EditorWindow(object):
from
Percolator
import
Percolator
from
ColorDelegator
import
ColorDelegator
from
UndoDelegator
import
UndoDelegator
from
IOBinding
import
IOBinding
from
IOBinding
import
IOBinding
,
filesystemencoding
,
encoding
import
Bindings
from
Tkinter
import
Toplevel
from
MultiStatusBar
import
MultiStatusBar
...
...
@@ -256,6 +256,21 @@ class EditorWindow(object):
self
.
askinteger
=
tkSimpleDialog
.
askinteger
self
.
showerror
=
tkMessageBox
.
showerror
def
_filename_to_unicode
(
self
,
filename
):
"""convert filename to unicode in order to display it in Tk"""
if
isinstance
(
filename
,
unicode
)
or
not
filename
:
return
filename
else
:
try
:
return
filename
.
decode
(
self
.
filesystemencoding
)
except
UnicodeDecodeError
:
# XXX
try
:
return
filename
.
decode
(
self
.
encoding
)
except
UnicodeDecodeError
:
# byte-to-byte conversion
return
filename
.
decode
(
'iso8859-1'
)
def
new_callback
(
self
,
event
):
dirname
,
basename
=
self
.
io
.
defaultfilename
()
self
.
flist
.
new
(
dirname
)
...
...
@@ -675,8 +690,10 @@ class EditorWindow(object):
menu
.
delete
(
1
,
END
)
# clear, and rebuild:
for
i
,
file
in
zip
(
count
(),
rf_list
):
file_name
=
file
[
0
:
-
1
]
# zap \n
# make unicode string to display non-ASCII chars correctly
ufile_name
=
self
.
_filename_to_unicode
(
file_name
)
callback
=
instance
.
__recent_file_callback
(
file_name
)
menu
.
add_command
(
label
=
ulchars
[
i
]
+
" "
+
file_name
,
menu
.
add_command
(
label
=
ulchars
[
i
]
+
" "
+
u
file_name
,
command
=
callback
,
underline
=
0
)
...
...
@@ -716,10 +733,12 @@ class EditorWindow(object):
filename
=
self
.
io
.
filename
if
filename
:
filename
=
os
.
path
.
basename
(
filename
)
return
filename
# return unicode string to display non-ASCII chars correctly
return
self
.
_filename_to_unicode
(
filename
)
def
long_title
(
self
):
return
self
.
io
.
filename
or
""
# return unicode string to display non-ASCII chars correctly
return
self
.
_filename_to_unicode
(
self
.
io
.
filename
or
""
)
def
center_insert_event
(
self
,
event
):
self
.
center
()
...
...
Lib/idlelib/IOBinding.py
Dosyayı görüntüle @
307021f4
...
...
@@ -32,6 +32,9 @@ try:
except
(
ImportError
,
locale
.
Error
):
pass
# Encoding for file names
filesystemencoding
=
sys
.
getfilesystemencoding
()
encoding
=
"ascii"
if
sys
.
platform
==
'win32'
:
# On Windows, we could use "mbcs". However, to give the user
...
...
@@ -517,7 +520,10 @@ class IOBinding:
if
not
self
.
opendialog
:
self
.
opendialog
=
tkFileDialog
.
Open
(
master
=
self
.
text
,
filetypes
=
self
.
filetypes
)
return
self
.
opendialog
.
show
(
initialdir
=
dir
,
initialfile
=
base
)
filename
=
self
.
opendialog
.
show
(
initialdir
=
dir
,
initialfile
=
base
)
if
isinstance
(
filename
,
unicode
):
filename
=
filename
.
encode
(
filesystemencoding
)
return
filename
def
defaultfilename
(
self
,
mode
=
"open"
):
if
self
.
filename
:
...
...
@@ -536,7 +542,10 @@ class IOBinding:
if
not
self
.
savedialog
:
self
.
savedialog
=
tkFileDialog
.
SaveAs
(
master
=
self
.
text
,
filetypes
=
self
.
filetypes
)
return
self
.
savedialog
.
show
(
initialdir
=
dir
,
initialfile
=
base
)
filename
=
self
.
savedialog
.
show
(
initialdir
=
dir
,
initialfile
=
base
)
if
isinstance
(
filename
,
unicode
):
filename
=
filename
.
encode
(
filesystemencoding
)
return
filename
def
updaterecentfileslist
(
self
,
filename
):
"Update recent file list on all editor windows"
...
...
Misc/NEWS
Dosyayı görüntüle @
307021f4
...
...
@@ -287,6 +287,8 @@ Extension Modules
Library
-------
- Patch #1162825: Support non-ASCII characters in IDLE window titles.
- Bug #1365984: urllib now opens "data:" URLs again.
- Patch #1314396: prevent deadlock for threading.Thread.join() when an exception
...
...
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