コード例 #1
0
 def scp(self, src, dst, download=False):
     """Use scp to copy a file from local host to remote device (if download
     is false), or from remote device to local host (if download is True)."""
     if download:
         return sshlib.scp(srchost=self.host, srcpath=src, dsthost=None, dstpath=dst,
             user=self.user, password=self.password, logfile=self._intf.fileobject().getlog())
     else:
         return sshlib.scp(srchost=None, srcpath=src, dsthost=self.host, dstpath=dst,
             user=self.user, password=self.password, logfile=self._intf.fileobject().getlog())
コード例 #2
0
ファイル: labmodel.py プロジェクト: animeshinvinci/pycopia
 def scp(self, rfile, dest, logfile=None):
     """Use the scp program to copy a file to or from this device."""
     from pycopia import sshlib
     sshlib.scp(self.name,
                rfile,
                dest,
                user=self.user,
                password=self.password,
                logfile=logfile)
コード例 #3
0
ファイル: labmodel.py プロジェクト: animeshinvinci/pycopia
 def scp(self, rfile, dest, logfile=None):
     """Use the scp program to copy a file to or from this device."""
     from pycopia import sshlib
     sshlib.scp(self.name, rfile, dest, user=self.user, password=self.password, logfile=logfile)