def yield_source_csv_messages(cls, foreign_cls, csvreader, force_column=None):
 columns = list(cls.__table__.c)
 column_names = next(csvreader)
 assert ([cls.__table__.c[name] for name in column_names] == columns), ','.join((c.name for c in columns))
 pk = columns[:len(cls.__table__.primary_key.columns)]
 first_string_index = len(pk)
 return _yield_csv_messages(foreign_cls, columns, first_string_index, csvreader, force_column=force_column)

def yield_source_csv_messages ( cls , foreign_cls , csvreader , force_column = None ) : columns = list ( cls . __table__ . c ) column_names = next ( csvreader ) assert ( [ cls . __table__ . c [ name ] for name in column_names ] == columns ) , ',' . join ( ( c . name for c in columns ) ) pk = columns [ : len ( cls . __table__ . primary_key . columns ) ] first_string_index = len ( pk ) return _yield_csv_messages ( foreign_cls , columns , first_string_index , csvreader , force_column = force_column )
yield all messages from one source csv file .