def readfile(self,filepath=''):
        
        #open a file
        fn=os.path.join(filepath,self.get_name()+'.xls')
        try:
            f=open(fn,'r')
        except IOError:
            raise Exception('No table, %s exists in %s' %(self.get_name(),filepath))
        
        # reset the current table
        if not self.isempty(): 
            warnings.warn("Resetting the current table, %s") %(self.get_name())
            self.table={}
         
        chrom=''
        for line in f.xreadlines():
            # obtaining the parameters
            line=line.strip()
            if line=='' or line[0]=="#": continue
                
            # get chromosomes
            elements=self.parse_line(line)
            newchrom=elements[0]
            # when new chromosome is met
            if chrom!=newchrom:
                chrom=newchrom
                self.init_table(chrom)
            self.add_row(chrom,elements[1:])
        
        f.close()
Tests that the function returns successfully.
dataset/ETHPy150Open taoliu/taolib/Assoc/tables.py/Table.readfile--crossover with--dataset/ETHPy150Open saltstack/salt/tests/unit/cloud/clouds/opennebula_test.py/OpenNebulaTestCase.test_get_vn_id_success