MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / readprofile

Method readprofile

tools/python-3.11.9-amd64/Lib/tkinter/__init__.py:2393–2413  ·  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

2391 _default_root = None
2392
2393 def readprofile(self, baseName, className):
2394 """Internal function. It reads .BASENAME.tcl and .CLASSNAME.tcl into
2395 the Tcl Interpreter and calls exec on the contents of .BASENAME.py and
2396 .CLASSNAME.py if such a file exists in the home directory."""
2397 import os
2398 if 'HOME' in os.environ: home = os.environ['HOME']
2399 else: home = os.curdir
2400 class_tcl = os.path.join(home, '.%s.tcl' % className)
2401 class_py = os.path.join(home, '.%s.py' % className)
2402 base_tcl = os.path.join(home, '.%s.tcl' % baseName)
2403 base_py = os.path.join(home, '.%s.py' % baseName)
2404 dir = {'self': self}
2405 exec('from tkinter import *', dir)
2406 if os.path.isfile(class_tcl):
2407 self.tk.call('source', class_tcl)
2408 if os.path.isfile(class_py):
2409 exec(open(class_py).read(), dir)
2410 if os.path.isfile(base_tcl):
2411 self.tk.call('source', base_tcl)
2412 if os.path.isfile(base_py):
2413 exec(open(base_py).read(), dir)
2414
2415 def report_callback_exception(self, exc, val, tb):
2416 """Report callback exception on sys.stderr.

Callers 1

__init__Method · 0.95

Calls 5

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

Tested by

no test coverage detected