Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
3e2f5746
Commit
3e2f5746
authored
Jul 12, 1994
by
Guido van Rossum
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
read various startup files in Tcl and Python based upon className and
baseName.
parent
b9c0fcf4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
46 additions
and
2 deletions
+46
-2
Lib/lib-tk/Tkinter.py
Lib/lib-tk/Tkinter.py
+23
-1
Lib/tkinter/Tkinter.py
Lib/tkinter/Tkinter.py
+23
-1
No files found.
Lib/lib-tk/Tkinter.py
View file @
3e2f5746
...
...
@@ -534,12 +534,34 @@ class Tk(Misc, Wm):
self
.
tk
=
tkinter
.
create
(
screenName
,
baseName
,
className
)
self
.
tk
.
createcommand
(
'tkerror'
,
_tkerror
)
self
.
tk
.
createcommand
(
'exit'
,
_exit
)
self
.
readprofile
(
baseName
,
className
)
def
destroy
(
self
):
for
c
in
self
.
children
.
values
():
c
.
destroy
()
## del self.master.children[self._name]
self
.
tk
.
call
(
'destroy'
,
self
.
_w
)
def
__str__
(
self
):
return
self
.
_w
def
readprofile
(
self
,
baseName
,
className
):
import
os
if
os
.
environ
.
has_key
(
'HOME'
):
home
=
os
.
environ
[
'HOME'
]
else
:
home
=
os
.
curdir
class_tcl
=
os
.
path
.
join
(
home
,
'.%s.tcl'
%
className
)
class_py
=
os
.
path
.
join
(
home
,
'.%s.py'
%
className
)
base_tcl
=
os
.
path
.
join
(
home
,
'.%s.tcl'
%
baseName
)
base_py
=
os
.
path
.
join
(
home
,
'.%s.py'
%
baseName
)
dir
=
{
'self'
:
self
}
exec
'from Tkinter import *'
in
dir
if
os
.
path
.
isfile
(
class_tcl
):
print
'source'
,
`class_tcl`
self
.
tk
.
call
(
'source'
,
class_tcl
)
if
os
.
path
.
isfile
(
class_py
):
print
'execfile'
,
`class_py`
execfile
(
class_py
,
dir
)
if
os
.
path
.
isfile
(
base_tcl
):
print
'source'
,
`base_tcl`
self
.
tk
.
call
(
'source'
,
base_tcl
)
if
os
.
path
.
isfile
(
base_py
):
print
'execfile'
,
`base_py`
execfile
(
base_py
,
dir
)
class
Pack
:
def
config
(
self
,
cnf
=
{}):
...
...
Lib/tkinter/Tkinter.py
View file @
3e2f5746
...
...
@@ -534,12 +534,34 @@ class Tk(Misc, Wm):
self
.
tk
=
tkinter
.
create
(
screenName
,
baseName
,
className
)
self
.
tk
.
createcommand
(
'tkerror'
,
_tkerror
)
self
.
tk
.
createcommand
(
'exit'
,
_exit
)
self
.
readprofile
(
baseName
,
className
)
def
destroy
(
self
):
for
c
in
self
.
children
.
values
():
c
.
destroy
()
## del self.master.children[self._name]
self
.
tk
.
call
(
'destroy'
,
self
.
_w
)
def
__str__
(
self
):
return
self
.
_w
def
readprofile
(
self
,
baseName
,
className
):
import
os
if
os
.
environ
.
has_key
(
'HOME'
):
home
=
os
.
environ
[
'HOME'
]
else
:
home
=
os
.
curdir
class_tcl
=
os
.
path
.
join
(
home
,
'.%s.tcl'
%
className
)
class_py
=
os
.
path
.
join
(
home
,
'.%s.py'
%
className
)
base_tcl
=
os
.
path
.
join
(
home
,
'.%s.tcl'
%
baseName
)
base_py
=
os
.
path
.
join
(
home
,
'.%s.py'
%
baseName
)
dir
=
{
'self'
:
self
}
exec
'from Tkinter import *'
in
dir
if
os
.
path
.
isfile
(
class_tcl
):
print
'source'
,
`class_tcl`
self
.
tk
.
call
(
'source'
,
class_tcl
)
if
os
.
path
.
isfile
(
class_py
):
print
'execfile'
,
`class_py`
execfile
(
class_py
,
dir
)
if
os
.
path
.
isfile
(
base_tcl
):
print
'source'
,
`base_tcl`
self
.
tk
.
call
(
'source'
,
base_tcl
)
if
os
.
path
.
isfile
(
base_py
):
print
'execfile'
,
`base_py`
execfile
(
base_py
,
dir
)
class
Pack
:
def
config
(
self
,
cnf
=
{}):
...
...
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