E5Network/E5Ftp.py

branch
Py2 comp.
changeset 3060
5883ce99ee12
parent 3058
0a02c433f52d
parent 3035
36e9f388958b
child 3065
070b35dde35e
equal deleted inserted replaced
3058:0a02c433f52d 3060:5883ce99ee12
300 if presp[0] == "3" and self.__proxyAccount: 300 if presp[0] == "3" and self.__proxyAccount:
301 presp = self.sendcmd("ACCT " + self.__proxyAccount) 301 presp = self.sendcmd("ACCT " + self.__proxyAccount)
302 if presp[0] != "2": 302 if presp[0] != "2":
303 raise E5FtpProxyError( 303 raise E5FtpProxyError(
304 "9{0}0 Error authorizing at proxy\n{1}".format( 304 "9{0}0 Error authorizing at proxy\n{1}".format(
305 presp[0], presp)) 305 presp[0], presp))
306 306
307 if self.__proxyType == E5FtpProxyType.Site: 307 if self.__proxyType == E5FtpProxyType.Site:
308 # send SITE command 308 # send SITE command
309 presp = self.sendcmd("SITE " + self.__host) 309 presp = self.sendcmd("SITE " + self.__host)
310 if presp[0] != "2": 310 if presp[0] != "2":
311 raise E5FtpProxyError( 311 raise E5FtpProxyError(
312 "9{0}0 Error sending SITE command\n{1}".format( 312 "9{0}0 Error sending SITE command\n{1}".format(
313 presp[0], presp)) 313 presp[0], presp))
314 elif self.__proxyType == E5FtpProxyType.Open: 314 elif self.__proxyType == E5FtpProxyType.Open:
315 # send OPEN command 315 # send OPEN command
316 presp = self.sendcmd("OPEN " + self.__host) 316 presp = self.sendcmd("OPEN " + self.__host)
317 if presp[0] != "2": 317 if presp[0] != "2":
318 raise E5FtpProxyError( 318 raise E5FtpProxyError(
319 "9{0}0 Error sending OPEN command\n{1}".format( 319 "9{0}0 Error sending OPEN command\n{1}".format(
320 presp[0], presp)) 320 presp[0], presp))
321 321
322 # authenticate to the remote host or combined to proxy and remote host 322 # authenticate to the remote host or combined to proxy and remote host
323 resp = self.sendcmd("USER " + user) 323 resp = self.sendcmd("USER " + user)
324 if resp[0] == "3": 324 if resp[0] == "3":
325 resp = self.sendcmd("PASS " + password) 325 resp = self.sendcmd("PASS " + password)
334 if presp[0] == "3": 334 if presp[0] == "3":
335 presp = self.sendcmd("RESP " + self.__proxyPassword) 335 presp = self.sendcmd("RESP " + self.__proxyPassword)
336 if presp[0] != "2": 336 if presp[0] != "2":
337 raise E5FtpProxyError( 337 raise E5FtpProxyError(
338 "9{0}0 Error authorizing at proxy\n{1}".format( 338 "9{0}0 Error authorizing at proxy\n{1}".format(
339 presp[0], presp)) 339 presp[0], presp))
340 340
341 return resp 341 return resp

eric ide

mercurial