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)
| 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. |