E5Network/E5Ftp.py

branch
Py2 comp.
changeset 2525
8b507a9a2d40
parent 2302
f29e9405c851
child 2911
ce77f0b1ee67
equal deleted inserted replaced
2523:139f182b72f6 2525:8b507a9a2d40
4 # 4 #
5 5
6 """ 6 """
7 Module implementing an extension to the Python FTP class to support FTP proxies. 7 Module implementing an extension to the Python FTP class to support FTP proxies.
8 """ 8 """
9
10 from __future__ import unicode_literals # __IGNORE_WARNING__
9 11
10 import ftplib 12 import ftplib
11 from socket import _GLOBAL_DEFAULT_TIMEOUT 13 from socket import _GLOBAL_DEFAULT_TIMEOUT
12 14
13 15
148 if self.__proxyType != E5FtpProxyType.NoProxy: 150 if self.__proxyType != E5FtpProxyType.NoProxy:
149 if not self.__proxyHost: 151 if not self.__proxyHost:
150 raise E5FtpProxyError( 152 raise E5FtpProxyError(
151 "990 Proxy usage requested, but no proxy host given.") 153 "990 Proxy usage requested, but no proxy host given.")
152 154
153 return super().connect(self.__proxyHost, self.__proxyPort, self.__timeout) 155 return super(E5Ftp, self).connect(self.__proxyHost, self.__proxyPort, self.__timeout)
154 else: 156 else:
155 return super().connect(self.__host, self.__port, self.__timeout) 157 return super(E5Ftp, self).connect(self.__host, self.__port, self.__timeout)
156 158
157 def login(self, user="", password="", acct=""): 159 def login(self, user="", password="", acct=""):
158 """ 160 """
159 Public method to login to the FTP server. 161 Public method to login to the FTP server.
160 162

eric ide

mercurial