def prepare_file(self, fname):
     '''Copy file to tftp server, so that it it available to tftp
     to the board itself.'''
     if fname.startswith("http://") or fname.startswith("https://"):
         return common.download_from_web(fname, self.tftp_server, self.tftp_username, self.tftp_password)
     else:
         return common.scp_to_tftp_server(os.path.abspath(fname), self.tftp_server, self.tftp_username, self.tftp_password)
Beispiel #2
0
 def prepare_file(self, fname):
     '''Copy file to tftp server, so that it it available to tftp
     to the board itself.'''
     if fname.startswith("http://") or fname.startswith("https://"):
         return common.download_from_web(fname, self.tftp_server, self.tftp_username, self.tftp_password, self.tftp_port)
     else:
         return common.scp_to_tftp_server(os.path.abspath(fname), self.tftp_server, self.tftp_username, self.tftp_password, self.tftp_port)
    def prepare_file(self, fname, tserver=None, tusername=None, tpassword=None, tport=None):
        '''Copy file to tftp server, so that it it available to tftp
        to the board itself.'''
        if tserver is None:
            tserver = self.tftp_server
        if tusername is None:
            tusername = self.tftp_username
        if tpassword is None:
            tpassword = self.tftp_password
        if tport is None:
            tport = self.tftp_port

        if fname.startswith("http://") or fname.startswith("https://"):
            return common.download_from_web(fname, tserver, tusername, tpassword, tport)
        else:
            return common.scp_to_tftp_server(os.path.abspath(fname), tserver, tusername, tpassword, tport)