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())
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)