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

def readprofile(self, baseName, className):

    import os
    if ('HOME' in os.environ):
        home = os.environ['HOME']
    else:
        home = os.curdir
    class_tcl = os.path.join(home, ('.%s.tcl' % className))
    class_py = os.path.join(home, ('.%s.py' % className))
    base_tcl = os.path.join(home, ('.%s.tcl' % baseName))
    base_py = os.path.join(home, ('.%s.py' % baseName))
    dir = {'self': self}
    exec 'from    Tkinter    import    *' in dir
    if os.path.isfile(class_tcl):
        self.tk.call('source', class_tcl)
    if os.path.isfile(class_py):
        execfile(class_py, dir)
    if os.path.isfile(base_tcl):
        self.tk.call('source', base_tcl)
    if os.path.isfile(base_py):
        execfile(base_py, dir)
