#NEWLINE# def retouch_serial_port( self ) : #NEWLINE# #INDENT# if self . do_touch : #NEWLINE# #INDENT# if timeout . wait_for_upload_port : #NEWLINE# #INDENT# time . sleep ( 0.1 ) #NEWLINE# timeout = ( time . time ( ) + 2 ) #NEWLINE# while ( timeout > time . time ( ) ) : #NEWLINE# #INDENT# ports = base . serial_port . list_serial_ports ( ) #NEWLINE# if ( self . upload_port in ports ) : #NEWLINE# #INDENT# base . serial_port . touch_port ( self . upload_port , 9600 ) #NEWLINE# break #NEWLINE# #UNINDENT# time . sleep ( 0.25 ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# base . serial_port . touch_port ( self . upload_port , 9600 )