MCPcopy Index your code
hub / github.com/RustPython/RustPython / readprofile

Method readprofile

Lib/tkinter/__init__.py:2511–2531  ·  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

2509 _default_root = None
2510
2511 def readprofile(self, baseName, className):
2512 """Internal function. It reads .BASENAME.tcl and .CLASSNAME.tcl into
2513 the Tcl Interpreter and calls exec on the contents of .BASENAME.py and
2514 .CLASSNAME.py if such a file exists in the home directory."""
2515 import os
2516 if 'HOME' in os.environ: home = os.environ['HOME']
2517 else: home = os.curdir
2518 class_tcl = os.path.join(home, '.%s.tcl' % className)
2519 class_py = os.path.join(home, '.%s.py' % className)
2520 base_tcl = os.path.join(home, '.%s.tcl' % baseName)
2521 base_py = os.path.join(home, '.%s.py' % baseName)
2522 dir = {'self': self}
2523 exec('from tkinter import *', dir)
2524 if os.path.isfile(class_tcl):
2525 self.tk.call('source', class_tcl)
2526 if os.path.isfile(class_py):
2527 exec(open(class_py).read(), dir)
2528 if os.path.isfile(base_tcl):
2529 self.tk.call('source', base_tcl)
2530 if os.path.isfile(base_py):
2531 exec(open(base_py).read(), dir)
2532
2533 def report_callback_exception(self, exc, val, tb):
2534 """Report callback exception on sys.stderr.

Callers 1

__init__Method · 0.95

Calls 6

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

Tested by

no test coverage detected