Logo Search packages:      
Sourcecode: relational version File versions  Download package

def relational::relation::relation::__str__ (   self  ) 

Returns a string representation of the relation, can be printed with 
monospaced fonts

Definition at line 395 of file relation.py.

00395                      :
        '''Returns a string representation of the relation, can be printed with 
        monospaced fonts'''
        m_len=[] #Maximum lenght string
        for f in self.header.attributes:
            m_len.append(len(f))
        
        for f in self.content:
            col=0
            for i in f:
                if len(i)>m_len[col]:
                    m_len[col]=len(i)
                col+=1
                
        
        res=""
        for f in range(len(self.header.attributes)):
            res+="%s"%(self.header.attributes[f].ljust(2+m_len[f]))
        
        
        for r in self.content:
            col=0
            res+="\n"
            for i in r:
                res+="%s"% (i.ljust(2+m_len[col]))
                col+=1
            
        return res

    def update(self,expr,dic):


Generated by  Doxygen 1.6.0   Back to index