#NEWLINE# def importData( self , data , onError ) : #NEWLINE# #INDENT# today = time . strftime ( '%Y%m%d' , time . localtime ( ) ) #NEWLINE# dateEntries = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# lines = data . split ( '\n' ) #NEWLINE# if ( len ( lines ) == 1 ) : #NEWLINE# #INDENT# lines = data . split ( '\r' ) #NEWLINE# #UNINDENT# lineno = 0 #NEWLINE# for line in lines : #NEWLINE# #INDENT# lineno += 1 #NEWLINE# line = line . strip ( ) #NEWLINE# if ( ( lines == '' ) or ( line [ 0 ] == '#' ) ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# if ( ( len ( line ) < 3 ) or ( line [ 0 ] != '"' ) or ( line [ ( - 1 ) ] != '"' ) ) : #NEWLINE# #INDENT# return onError ( lineno , line ) #NEWLINE# #UNINDENT# s = line [ 1 : ( - 1 ) ] #NEWLINE# cols = s . split ( '","' ) #NEWLINE# if ( len ( cols ) != 5 ) : #NEWLINE# #INDENT# return onError ( lineno , line ) #NEWLINE# #UNINDENT# date = cols [ 0 ] #NEWLINE# if ( date == 'TODAY' ) : #NEWLINE# #INDENT# date = today #NEWLINE# #UNINDENT# if ( not dateEntries . has_key ( date ) ) : #NEWLINE# #INDENT# dateEntries [ date ] = [ ] #NEWLINE# #UNINDENT# dateEntries [ date ] . append ( cols [ 1 : ] ) #NEWLINE# #UNINDENT# self . clear ( ) #NEWLINE# dates = dateEntries . keys ( ) #NEWLINE# dates . sort ( ) #NEWLINE# for date in dates : #NEWLINE# #INDENT# thisDate = [ ] #NEWLINE# for cols in dateEntries [ date ] : #NEWLINE# #INDENT# timeVO = TimeVO ( * cols ) #NEWLINE# thisDate . append ( timeVO ) #NEWLINE# #UNINDENT# self . setDateEntries ( date , thisDate ) #NEWLINE# #UNINDENT# return date