eric6.E5Network.E5Ftp

Module implementing an extension to the Python FTP class to support FTP proxies.

Global Attributes

None

Classes

E5Ftp Class implementing an extension to the Python FTP class to support FTP proxies.
E5FtpProxyError Class to signal an error related to proxy configuration.
E5FtpProxyType Class defining the supported FTP proxy types.

Functions

None


E5Ftp

Class implementing an extension to the Python FTP class to support FTP proxies.

Derived from

ftplib.FTP

Class Attributes

None

Class Methods

None

Methods

E5Ftp Constructor
connect Public method to connect to the given FTP server.
login
setProxy Public method to set the proxy configuration.
setProxyAuthentication Public method to set the proxy authentication info.

Static Methods

None

E5Ftp (Constructor)

E5Ftp(host="", user="", password="", acct="", proxyType=E5FtpProxyType.NO_PROXY, proxyHost="", proxyPort=ftplib.FTP_PORT, proxyUser="", proxyPassword="", proxyAccount="", timeout=_GLOBAL_DEFAULT_TIMEOUT)

Constructor

host (str)
name of the FTP host
user (str)
user name for login to FTP host
password (str)
password for login to FTP host
acct (str)
account for login to FTP host
proxyType (E5FtpProxyType)
type of the FTP proxy
proxyHost (str)
name of the FTP proxy
proxyPort (int)
port of the FTP proxy
proxyUser (str)
user name for login to the proxy
proxyPassword (str)
password for login to the proxy
proxyAccount (str)
accounting info for the proxy
timeout (int)
timeout in seconds for blocking operations

E5Ftp.connect

connect(host="", port=0, timeout=-999)

Public method to connect to the given FTP server.

This extended method connects to the proxy instead of the given host, if a proxy is to be used. It throws an exception, if the proxy data is incomplete.

host (str)
name of the FTP host
port (int)
port of the FTP host
timeout (int)
timeout in seconds for blocking operations
Return:
welcome message of the server
Return Type:
str
Raises E5FtpProxyError:
raised to indicate a proxy related issue

E5Ftp.login

login(user="", password="", acct="")

E5Ftp.setProxy

setProxy(proxyType=E5FtpProxyType.NO_PROXY, proxyHost="", proxyPort=ftplib.FTP_PORT, proxyUser="", proxyPassword="", proxyAccount="")

Public method to set the proxy configuration.

proxyType (E5FtpProxyType)
type of the FTP proxy
proxyHost (str)
name of the FTP proxy
proxyPort (int)
port of the FTP proxy
proxyUser (str)
user name for login to the proxy
proxyPassword (str)
password for login to the proxy
proxyAccount (str)
accounting info for the proxy

E5Ftp.setProxyAuthentication

setProxyAuthentication(proxyUser="", proxyPassword="", proxyAccount="")

Public method to set the proxy authentication info.

proxyUser (str)
user name for login to the proxy
proxyPassword (str)
password for login to the proxy
proxyAccount (str)
accounting info for the proxy
Up


E5FtpProxyError

Class to signal an error related to proxy configuration.

The error message starts with a three digit error code followed by a space and the error string. Supported error codes are:

Derived from

ftplib.Error

Class Attributes

None

Class Methods

None

Methods

None

Static Methods

None
Up


E5FtpProxyType

Class defining the supported FTP proxy types.

Derived from

enum.Enum

Class Attributes

AUTH_RESP
BLUECOAT
NON_AUTHORIZING
NO_PROXY
OPEN
PROXYUSER_SERVER
SITE
USER_PROXYUSER_SERVER
USER_SERVER

Class Methods

None

Methods

None

Static Methods

None
Up