MCPcopy Index your code
hub / github.com/python/cpython / readprofile

Method readprofile

Lib/tkinter/__init__.py:2585–2605  ·  view source on GitHub ↗

Internal function. It reads .BASENAME.tcl and .CLASSNAME.tcl into the Tcl Interpreter and calls exec on the contents of .BASENAME.py and .CLASSNAME.py if such a file exists in the home directory.

(self, baseName, className)

Source from the content-addressed store, hash-verified

2583 _default_root = None
2584
2585 def readprofile(self, baseName, className):
2586 """Internal function. It reads .BASENAME.tcl and .CLASSNAME.tcl into
2587 the Tcl Interpreter and calls exec on the contents of .BASENAME.py and
2588 .CLASSNAME.py if such a file exists in the home directory."""
2589 import os
2590 if 'HOME' in os.environ: home = os.environ['HOME']
2591 else: home = os.curdir
2592 class_tcl = os.path.join(home, '.%s.tcl' % className)
2593 class_py = os.path.join(home, '.%s.py' % className)
2594 base_tcl = os.path.join(home, '.%s.tcl' % baseName)
2595 base_py = os.path.join(home, '.%s.py' % baseName)
2596 dir = {'self': self}
2597 exec('from tkinter import *', dir)
2598 if os.path.isfile(class_tcl):
2599 self.tk.call('source', class_tcl)
2600 if os.path.isfile(class_py):
2601 exec(open(class_py).read(), dir)
2602 if os.path.isfile(base_tcl):
2603 self.tk.call('source', base_tcl)
2604 if os.path.isfile(base_py):
2605 exec(open(base_py).read(), dir)
2606
2607 def report_callback_exception(self, exc, val, tb):
2608 """Report callback exception on sys.stderr.

Callers 1

__init__Method · 0.95

Calls 5

openFunction · 0.50
joinMethod · 0.45
isfileMethod · 0.45
callMethod · 0.45
readMethod · 0.45

Tested by

no test coverage detected