Package install :: Package MoSTBioDat :: Package Transfer :: Module SFTPtools :: Class SFTPtools
[hide private]
[frames] | no frames]

Class SFTPtools

source code

object --+
         |
        SFTPtools


methods to connect and transfer files
INPUT:
rserver - str, servername 
ruser - str, remote user, default Anonymous   
rpasswd - str, remote password, default empty
rdir - str, remote directory, default '.'
log - boolean
logfile - str, path to logfile
kwarg:
    format - string format for log handler
    filter - filter object from logger object
    datefmt - data/time format
    path - directory path to log file
    filename - log file name, default log
    filemode - mode to open log file, default='a'
    level - set root logger level to specified level
    logfilelevel- set level to log file 
OUTPUT:
class object

Instance Methods [hide private]
 
__init__(self, rserver=None, ruser='Anonymous', rpasswd='', rdir='.', log=True, logfile='/home/abak/ssh.log', port=22, *args, **kwargs)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
isSFtp(self)
check whether ssh server is available INPUT: class object OUTPUT: boolean
source code
 
connectSFtp(self)
connect to SSH server INPUT: class object OUTPUT: connection object sftp client object
source code
 
isEmpty(self, path='.')
check whether directory accessible for displaying INPUT: path - str, path on remote machine, default '.' OUTPUT: boolean
source code
 
lsSFtp(self, path='.', flag=True)
list files on SSH server INPUT: class object path - str, path on remote machine, default '.' flag - boolean: default True - list files OUTPUT: list of class object
source code
 
pwdSFtp(self, flag=True)
print working directory on FTP server INPUT: class object flag - boolean: default True - print current working directory
source code
 
cdSFtp(self, path='.')
change directory on SSH server INPUT: class object path - str, path to be changed on remote machine, default '.' OUTPUT boolean: True - enable to change directory
source code
 
getSFtp(self, filelist=[], localpath='', binary=True)
get specified files from current working directory to local machine INPUT: class object filelist - list of files to be downloaded [str] - default [] localpath - str, path on the local machine, default default current working directory binary - boolean, default True - binary transfer
source code
 
mgetSFtp(self, localpath='', binary=True)
get all files from current working directory to specified path on local machine INPUT: class object localpath - str, path on the local machine, default current working directory binary - boolean: default True - binary transfer
source code
 
byeSFtp(self)
close SSH connection
source code

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, rserver=None, ruser='Anonymous', rpasswd='', rdir='.', log=True, logfile='/home/abak/ssh.log', port=22, *args, **kwargs)
(Constructor)

source code 

x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Overrides: object.__init__
(inherited documentation)