#NEWLINE# def file_choice( summary_file , tables , verbose ) : #NEWLINE# #INDENT# '\n    ' #NEWLINE# url = ( 'http://census-tools.teczno.com/%s.txt' % summary_file ) #NEWLINE# src = StringIO ( urlopen ( url ) . read ( ) ) #NEWLINE# files = [ ] #NEWLINE# for table in tables : #NEWLINE# #INDENT# src . seek ( 0 ) #NEWLINE# ( file_name , column_offset ) = ( None , 5 ) #NEWLINE# for row in DictReader ( src , dialect = 'excel-tab' ) : #NEWLINE# #INDENT# ( curr_file , curr_table , cell_count ) = ( row . get ( 'File Name' ) , row . get ( 'Matrix Number' ) , int ( row . get ( 'Cell Count' ) ) ) #NEWLINE# if ( curr_file != file_name ) : #NEWLINE# #INDENT# ( file_name , column_offset ) = ( curr_file , 5 ) #NEWLINE# #UNINDENT# if ( curr_table == table ) : #NEWLINE# #INDENT# if verbose : #NEWLINE# #INDENT# ( ( print >> stderr ) , table , '-' , row . get ( 'Name' ) , 'in' , row . get ( 'Universe' ) ) #NEWLINE# #UNINDENT# files . append ( ( table , row , column_offset , cell_count ) ) #NEWLINE# break #NEWLINE# #UNINDENT# column_offset += cell_count #NEWLINE# #UNINDENT# #UNINDENT# return files