Project

General

Profile

« Previous | Next » 

Revision 5589

csv2db, tnrs_db: Removed ProgressInputStream wrapper around input stream, which is no longer needed (and causes overlapping output) now that sql_io.append_csv() prints # rows read

View differences:

bin/tnrs_db
82 82
        else:
83 83
            log('Storing TNRS response data')
84 84
            stream_info = csvs.stream_info(stream, parse_header=True)
85
            stream = streams.ProgressInputStream(stream, sys.stderr, n=1000)
86 85
            sql_io.append_csv(db, tnrs_data, stream_info, stream)
87 86

  
88 87
main()
bin/csv2db
50 50
        # Open input stream
51 51
        proc = subprocess.Popen(input_cmd, stdout=subprocess.PIPE, bufsize=-1)
52 52
        in_ = proc.stdout
53
        line_in = streams.ProgressInputStream(in_, sys.stderr, n=1000)
54 53
        
55 54
        # Import data
56
        try: sql_io.import_csv(db, table, line_in)
55
        try: sql_io.import_csv(db, table, in_)
57 56
        finally:
58
            line_in.close() # also closes proc.stdout
57
            in_.close() # also closes proc.stdout
59 58
            proc.wait()
60 59
    
61 60
    if input_cmd != []:

Also available in: Unified diff