E5Network/E5Ftp.py

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

eric ide

mercurial