@staticmethod
    def displayRow( pRow, pDescription, pDepth=0 ):
        '''
        Print content row for a particular table description and data.
        '''
        line=""
        for column in pDescription.columns:

            if column['visible'] == True:

                try:
                    if type(column['field']) is tuple:
                        # The field is a formula
                        formula = column['field'][0]
                        args = [ pRow[curField] for curField in column['field'][1:] ]

                        try:
                            data = str(formula( *args ))
                        except Exception, e:
                            print "Invalid formula execution for %r --> %r" % (column['field'], e)
                            sys.exit()

                        # Apply transformation if specified, this process take a data and calls a method to retrieve a string
                        if 'transform' in column.keys():
                            try:
                                data = column['transform']( data )
                            except Exception, e:
                                print "Invalid transformation for column %s = %r --> %r" % (column['label'], data, e)
                                sys.exit()

                    elif column['field'] not in pRow or pRow[column['field']] is None:
                        # The field is None or does not exists in row, use replacement text
                        data = "-"
                    else:
                        data = pRow[column['field']]

                        # Apply transformation if specified, this process take a data and calls a method to retrieve a string
                        if 'transform' in column.keys():
                            try:
                                data = column['transform']( data )
                            except Exception, e:
                                print "Invalid transformation for column %r --> %r" % (column['field'], e)
                                sys.exit()

                    # Limit length of the data if specified
                    if 'truncate' in column.keys() and len(data) > column['truncate']:
                        data = data[:(column['truncate']-3)]+"..."

                    line += column['dataFormat'] % data

                except __HOLE__, e:
                    print "Error displaying column %r --> %r" % ( column, e )
                    raise e

        # Once all columns are processed, display the full line
        if pDepth == 0:
            print line
        else:
            print (" "*pDepth)+"`"+line

        if 'items' in pRow:
            pDepth += 1
            for child in pRow['items']:
                CustomTable.displayRow( child, pDescription, pDepth )
dataset/ETHPy150Open mikrosimage/OpenRenderManagement/src/pulitools/puliquery/common.py/CustomTable.displayRow