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
1b6f398c
Kaydet (Commit)
1b6f398c
authored
Ock 11, 2005
tarafından
Kurt B. Kaiser
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Improve error handling when .idlerc can't be created.
üst
d4f5b07e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
14 deletions
+16
-14
configHandler.py
Lib/idlelib/configHandler.py
+16
-14
No files found.
Lib/idlelib/configHandler.py
Dosyayı görüntüle @
1b6f398c
...
...
@@ -193,26 +193,28 @@ class IdleConf:
"""
Creates (if required) and returns a filesystem directory for storing
user config files.
"""
cfgDir
=
'.idlerc'
userDir
=
os
.
path
.
expanduser
(
'~'
)
if
userDir
!=
'~'
:
#
'HOME' exists as a key in os.environ
cfgDir
=
'.idlerc'
userDir
=
os
.
path
.
expanduser
(
'~'
)
if
userDir
!=
'~'
:
#
expanduser() found user home dir
if
not
os
.
path
.
exists
(
userDir
):
warn
=
(
'
\n
Warning: HOME environment variable
points to
\n
'
+
userDir
+
'
\n
but the path does not exist.
\n
'
)
warn
=
(
'
\n
Warning: os.path.expanduser("~")
points to
\n
'
+
userDir
+
'
,
\n
but the path does not exist.
\n
'
)
sys
.
stderr
.
write
(
warn
)
userDir
=
'~'
if
userDir
==
'~'
:
#we still don't have a home directory
#
traditionally idle has defaulted to os.getcwd(), is this adeq
ate?
userDir
=
os
.
getcwd
()
#hack for no real homedir
userDir
=
os
.
path
.
join
(
userDir
,
cfgDir
)
userDir
=
'~'
if
userDir
==
"~"
:
# still no path to home!
#
traditionally IDLE has defaulted to os.getcwd(), is this adequ
ate?
userDir
=
os
.
getcwd
()
userDir
=
os
.
path
.
join
(
userDir
,
cfgDir
)
if
not
os
.
path
.
exists
(
userDir
):
try
:
#make the config dir if it doesn't exist yet
try
:
os
.
mkdir
(
userDir
)
except
IOError
:
warn
=
(
'
\n
Warning: unable to create user config directory
\n
'
+
userDir
+
'
\n
'
)
except
(
OSError
,
IOError
)
:
warn
=
(
'
\n
Warning: unable to create user config directory
\n
'
+
userDir
+
'
\n
Check path and permissions.
\n
Exiting!
\n\n
'
)
sys
.
stderr
.
write
(
warn
)
raise
SystemExit
return
userDir
def
GetOption
(
self
,
configType
,
section
,
option
,
default
=
None
,
type
=
None
,
...
...
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