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
5b0b00fb
Kaydet (Commit)
5b0b00fb
authored
Kas 30, 2002
tarafından
Neal Norwitz
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Convert string exceptions to classes, string exceptions are deprecated
üst
672ce571
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
8 deletions
+16
-8
configHandler.py
Lib/idlelib/configHandler.py
+10
-5
tabpage.py
Lib/idlelib/tabpage.py
+6
-3
No files found.
Lib/idlelib/configHandler.py
Dosyayı görüntüle @
5b0b00fb
...
...
@@ -11,6 +11,11 @@ Provides access to stored idle configuration information.
import
os
,
sys
,
string
from
ConfigParser
import
ConfigParser
,
NoOptionError
,
NoSectionError
class
InvalidConfigType
(
Exception
):
pass
class
InvalidConfigSet
(
Exception
):
pass
class
InvalidFgBg
(
Exception
):
pass
class
InvalidTheme
(
Exception
):
pass
class
IdleConfParser
(
ConfigParser
):
"""
A ConfigParser specialised for idle configuration file handling
...
...
@@ -228,13 +233,13 @@ class IdleConf:
configType must be one of ('main','extensions','highlight','keys')
"""
if
not
(
configType
in
(
'main'
,
'extensions'
,
'highlight'
,
'keys'
)):
raise
'Invalid configType specified'
raise
InvalidConfigType
,
'Invalid configType specified'
if
configSet
==
'user'
:
cfgParser
=
self
.
userCfg
[
configType
]
elif
configSet
==
'default'
:
cfgParser
=
self
.
defaultCfg
[
configType
]
else
:
raise
'Invalid configSet specified'
raise
InvalidConfigSet
,
'Invalid configSet specified'
return
cfgParser
.
sections
()
def
GetHighlight
(
self
,
theme
,
element
,
fgBg
=
None
):
...
...
@@ -262,7 +267,7 @@ class IdleConf:
if
fgBg
==
'bg'
:
return
highlight
[
"background"
]
else
:
raise
'Invalid fgBg specified'
raise
InvalidFgBg
,
'Invalid fgBg specified'
def
GetThemeDict
(
self
,
type
,
themeName
):
"""
...
...
@@ -278,7 +283,7 @@ class IdleConf:
elif
type
==
'default'
:
cfgParser
=
self
.
defaultCfg
[
'highlight'
]
else
:
raise
'Invalid theme type specified'
raise
InvalidTheme
,
'Invalid theme type specified'
#foreground and background values are provded for each theme element
#(apart from cursor) even though all these values are not yet used
#by idle, to allow for their use in the future. Default values are
...
...
@@ -561,7 +566,7 @@ class IdleConf:
elif
configSet
==
'default'
:
cfgParser
=
self
.
defaultCfg
[
'main'
]
else
:
raise
'Invalid configSet specified'
raise
InvalidConfigSet
,
'Invalid configSet specified'
options
=
cfgParser
.
GetOptionList
(
'HelpFiles'
)
for
option
in
options
:
value
=
cfgParser
.
Get
(
'HelpFiles'
,
option
,
default
=
';'
)
...
...
Lib/idlelib/tabpage.py
Dosyayı görüntüle @
5b0b00fb
...
...
@@ -4,6 +4,9 @@ a couple of classes for implementing partial tabbed-page like behaviour
from
Tkinter
import
*
class
InvalidTabPage
(
Exception
):
pass
class
AlreadyExists
(
Exception
):
pass
class
PageTab
(
Frame
):
"""
a 'page tab' like framed button
...
...
@@ -43,7 +46,7 @@ class TabPageSet(Frame):
if
pageName
in
self
.
pages
.
keys
():
self
.
activePage
.
set
(
pageName
)
else
:
raise
'Invalid TabPage Name'
raise
InvalidTabPage
,
'Invalid TabPage Name'
## pop up the active 'tab' only
for
page
in
self
.
pages
.
keys
():
self
.
pages
[
page
][
'tab'
]
.
config
(
relief
=
RIDGE
)
...
...
@@ -56,7 +59,7 @@ class TabPageSet(Frame):
def
AddPage
(
self
,
pageName
):
if
pageName
in
self
.
pages
.
keys
():
raise
'TabPage Name Already Exists'
raise
AlreadyExists
,
'TabPage Name Already Exists'
self
.
pages
[
pageName
]
=
{
'tab'
:
PageTab
(
self
.
tabBar
),
'page'
:
Frame
(
self
,
borderwidth
=
2
,
relief
=
RAISED
)}
self
.
pages
[
pageName
][
'tab'
]
.
button
.
config
(
text
=
pageName
,
...
...
@@ -71,7 +74,7 @@ class TabPageSet(Frame):
def
RemovePage
(
self
,
pageName
):
if
not
pageName
in
self
.
pages
.
keys
():
raise
'Invalid TabPage Name'
raise
InvalidTabPage
,
'Invalid TabPage Name'
self
.
pages
[
pageName
][
'tab'
]
.
pack_forget
()
self
.
pages
[
pageName
][
'page'
]
.
grid_forget
()
self
.
pages
[
pageName
][
'tab'
]
.
destroy
()
...
...
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