read the list of thoughts from a text file

def load_plan(self, fname):    
        """ read the list of thoughts from a text file """
        with open(fname, "r") as f:
            for line in f:
                if line != '': 
                    tpe, txt = self.parse_plan_from_string(line)
                    #print('tpe= "' + tpe + '"', txt)
                    if tpe == 'name':
                        self.name = txt
                    elif tpe == 'version':
                        self.plan_version = txt
                    elif tpe == 'belief':
                        self.beliefs.add(txt)
                    elif tpe == 'desire':
                        self.desires.add(txt)
                    elif tpe == 'intention':
                        self.intentions.add(txt)