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