#NEWLINE# def extract_columns_from_table_definition_file( xmltag , table_definition_file ) : #NEWLINE# #INDENT# '\n    Extract all columns mentioned in the result tag of a table definition file.\n    ' #NEWLINE# def handle_path( path ) : #NEWLINE# #INDENT# 'Convert path from a path relative to table-definition file.' #NEWLINE# if ( ( not path ) or path . startswith ( 'http://' ) or path . startswith ( 'https://' ) ) : #NEWLINE# #INDENT# return path #NEWLINE# #UNINDENT# return os . path . join ( os . path . dirname ( table_definition_file ) , path ) #NEWLINE# #UNINDENT# return [ Column ( c . get ( 'title' ) , xmltag . text , c . get ( 'numberOfDigits' ) , handle_path ( c . get ( 'href' ) ) , None , c . get ( 'displayUnit' ) , c . get ( 'scaleFactor' ) ) for c in xmltag . findall ( 'column' ) ]