#NEWLINE# def upload( self , * parameters ) : #NEWLINE# #INDENT# 'Upload a firmware in Arduino' #NEWLINE# parser = argparse . ArgumentParser ( description = self . upload . __doc__ , prog = ( 'bii %s:upload' % self . group ) ) #NEWLINE# parser . add_argument ( 'firmware' , type = str , nargs = '?' , help = 'firmwares to upload' ) #NEWLINE# parser . add_argument ( '--ssh' , type = str , nargs = '?' , default = argparse . SUPPRESS , help = 'Upload by ssh. You can specify the IP (default 192.168.240.1)' ) #NEWLINE# args = parser . parse_args ( * parameters ) #NEWLINE# super ( ArduinoToolChain , self ) . build ( ) #NEWLINE# if ( 'ssh' in args ) : #NEWLINE# #INDENT# ip = ( args . ssh or '192.168.240.1' ) #NEWLINE# self . arduino . ssh_upload ( args . firmware , ip ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . arduino . refresh_port ( ) #NEWLINE# self . arduino . upload ( args . firmware ) #NEWLINE# #UNINDENT# self . bii . user_io . out . success ( 'Upload finished' )