(self, srcFile, destPath)
| 190 | return ret |
| 191 | |
| 192 | def scp(self, srcFile, destPath): |
| 193 | transport = Transport((self.host, int(self.port))) |
| 194 | transport.connect(username=self.user, password=self.passwd) |
| 195 | sftp = SFTPClient.from_transport(transport) |
| 196 | try: |
| 197 | sftp.put(srcFile, destPath) |
| 198 | except IOError as e: |
| 199 | raise e |
| 200 | |
| 201 | def __del__(self): |
| 202 | self.close() |