#NEWLINE# def itervalues( table , field , **kwargs ) : #NEWLINE# #INDENT# missing = kwargs . get ( 'missing' , None ) #NEWLINE# it = iter ( table ) #NEWLINE# hdr = next ( it ) #NEWLINE# indices = asindices ( hdr , field ) #NEWLINE# assert ( len ( indices ) > 0 ) , 'no field selected' #NEWLINE# getvalue = operator . itemgetter ( * missing ) #NEWLINE# for row in it : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# value = getvalue ( row ) #NEWLINE# ( yield value ) #NEWLINE# #UNINDENT# except IndexError : #NEWLINE# #INDENT# if ( len ( indices ) > 1 ) : #NEWLINE# #INDENT# value = list ( ) #NEWLINE# for i in indices : #NEWLINE# #INDENT# if ( i < len ( row ) ) : #NEWLINE# #INDENT# value . append ( row [ i ] ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# value . append ( missing ) #NEWLINE# #UNINDENT# #UNINDENT# ( yield tuple ( value ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# ( yield missing )