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

Class FTPtools

source code

object --+
         |
        FTPtools


methods to connect and transfer files
INPUT:
rserver - str, servername
rdir - str, remote directory 
ruser - str, remote user, default Anonymous
rpasswd - str, remote password
kwargs:
    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='.', port=21, *args, **kwargs)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
isFtp(self)
check whether FTP server exists INPUT: clas object OUTPUT: boolen
source code
 
isEmpty(self, path='.')
check whether directory accessible for dispalying INPUT: class object path - str, path on remote machine, default current OUTPUT: boolean
source code
 
connectFtp(self)
connect to FTP server INPUT: class object OUTPUT: connection object
source code
 
lsFtp(self, path='.', flag=True)
list files on FTP server INPUT: class object path - str, path on remote machine, default current flag - boolean: default True - list files OUTPUT: list of class object
source code
 
pwdFtp(self, flag=True)
print working directory on FTP server INPUT: class object flag - boolean: default True - print current working directory
source code
 
cdFtp(self, path='.')
change directory on FTP server INPUT: class object path - str, path to be changed on remote machine - default '.' OUTPUT boolean: True - enable to change directory
source code
 
getFtp(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 empty binary - boolean: default True - binary transfer
source code
 
mgetFtp(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
 
byeFtp(self)
close ftp 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='.', port=21, *args, **kwargs)
(Constructor)

source code 

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

Overrides: object.__init__
(inherited documentation)