Sat, 23 Feb 2013 11:29:01 +0100
Added code to enable/disable certain entries of the Project->Session and Project->Debugger menus.
2074
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1 | # -*- coding: utf-8 -*- |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
2 | |
2302
f29e9405c851
Updated copyright for 2013.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2077
diff
changeset
|
3 | # Copyright (c) 2012 - 2013 Detlev Offenbach <detlev@die-offenbachs.de> |
2074
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
4 | # |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
5 | |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
6 | """ |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
7 | Module implementing an extension to the Python FTP class to support FTP proxies. |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
8 | """ |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
9 | |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
10 | import ftplib |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
11 | from socket import _GLOBAL_DEFAULT_TIMEOUT |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
12 | |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
13 | |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
14 | class E5FtpProxyError(ftplib.Error): |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
15 | """ |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
16 | Class to signal an error related to proxy configuration. |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
17 | |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
18 | The error message starts with a three digit error code followed by a |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
19 | space and the error string. Supported error codes are: |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
20 | <ul> |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
21 | <li>910: proxy error; the second number gives the category of the proxy error. |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
22 | The original response from the proxy is appended in the next line.</li> |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
23 | <li>930: proxy error; the second number gives the category of the proxy error. |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
24 | The original response from the proxy is appended in the next line.</li> |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
25 | <li>940: proxy error; the second number gives the category of the proxy error. |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
26 | The original response from the proxy is appended in the next line.</li> |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
27 | <li>950: proxy error; the second number gives the category of the proxy error. |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
28 | The original response from the proxy is appended in the next line.</li> |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
29 | <li>990: proxy usage is enabled but no proxy host given</li> |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
30 | <li>991: proxy usage is enabled but no proxy user given</li> |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
31 | <li>992: proxy usage is enabled but no proxy password given</li> |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
32 | </ul> |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
33 | """ |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
34 | pass |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
35 | |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
36 | |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
37 | class E5FtpProxyType(object): |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
38 | """ |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
39 | Class defining the supported FTP proxy types. |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
40 | """ |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
41 | NoProxy = 0 # no proxy |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
42 | NonAuthorizing = 1 # non authorizing proxy |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
43 | UserAtServer = 2 # proxy login first, than user@remote.host |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
44 | Site = 3 # proxy login first, than use SITE command |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
45 | Open = 4 # proxy login first, than use OPEN command |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
46 | UserAtProxyuserAtServer = 5 # one login for both |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
47 | ProxyuserAtServer = 6 # proxy login with remote host given, than |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
48 | # normal remote login |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
49 | AuthResp = 7 # authenticate to proxy with AUTH and RESP commands |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
50 | Bluecoat = 8 # bluecoat proxy |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
51 | |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
52 | |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
53 | class E5Ftp(ftplib.FTP): |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
54 | """ |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
55 | Class implementing an extension to the Python FTP class to support FTP proxies. |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
56 | """ |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
57 | def __init__(self, host="", user="", password="", acct="", |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
58 | proxyType=E5FtpProxyType.NoProxy, proxyHost="", proxyPort=ftplib.FTP_PORT, |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
59 | proxyUser="", proxyPassword="", proxyAccount="", |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
60 | timeout=_GLOBAL_DEFAULT_TIMEOUT): |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
61 | """ |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
62 | Constructor |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
63 | |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
64 | @param host name of the FTP host (string) |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
65 | @param user user name for login to FTP host (string) |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
66 | @param password password for login to FTP host (string) |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
67 | @param acct account for login to FTP host (string) |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
68 | @param proxyType type of the FTP proxy (integer 0 to 8) |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
69 | @param proxyHost name of the FTP proxy (string) |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
70 | @param proxyPort port of the FTP proxy (integer) |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
71 | @param proxyUser user name for login to the proxy (string) |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
72 | @param proxyPassword password for login to the proxy (string) |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
73 | @param proxyAccount accounting info for the proxy (string) |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
74 | @param timeout timeout in seconds for blocking operations (integer) |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
75 | """ |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
76 | self.__timeout = timeout |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
77 | |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
78 | self.__proxyType = proxyType |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
79 | self.__proxyHost = proxyHost |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
80 | self.__proxyPort = proxyPort |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
81 | self.__proxyUser = proxyUser |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
82 | self.__proxyPassword = proxyPassword |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
83 | self.__proxyAccount = proxyAccount |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
84 | |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
85 | self.__host = host |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
86 | self.__port = ftplib.FTP_PORT |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
87 | self.__user = user |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
88 | self.__password = password |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
89 | self.__acct = acct |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
90 | |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
91 | if host: |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
92 | self.connect(host) |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
93 | if user: |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
94 | self.login(user, password, acct) |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
95 | |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
96 | def setProxy(self, proxyType=E5FtpProxyType.NoProxy, proxyHost="", |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
97 | proxyPort=ftplib.FTP_PORT, proxyUser="", proxyPassword="", proxyAccount=""): |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
98 | """ |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
99 | Public method to set the proxy configuration. |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
100 | |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
101 | @param proxyType type of the FTP proxy (integer 0 to 8) |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
102 | @param proxyHost name of the FTP proxy (string) |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
103 | @param proxyPort port of the FTP proxy (integer) |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
104 | @param proxyUser user name for login to the proxy (string) |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
105 | @param proxyPassword password for login to the proxy (string) |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
106 | @param proxyAccount accounting info for the proxy (string) |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
107 | """ |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
108 | self.__proxyType = proxyType |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
109 | self.__proxyHost = proxyHost |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
110 | self.__proxyPort = proxyPort |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
111 | self.__proxyUser = proxyUser |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
112 | self.__proxyPassword = proxyPassword |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
113 | self.__proxyAccount = proxyAccount |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
114 | |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
115 | def setProxyAuthentication(self, proxyUser="", proxyPassword="", proxyAccount=""): |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
116 | """ |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
117 | Public method to set the proxy authentication info. |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
118 | |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
119 | @param proxyUser user name for login to the proxy (string) |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
120 | @param proxyPassword password for login to the proxy (string) |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
121 | @param proxyAccount accounting info for the proxy (string) |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
122 | """ |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
123 | self.__proxyUser = proxyUser |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
124 | self.__proxyPassword = proxyPassword |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
125 | self.__proxyAccount = proxyAccount |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
126 | |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
127 | def connect(self, host="", port=0, timeout=-999): |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
128 | """ |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
129 | Public method to connect to the given FTP server. |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
130 | |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
131 | This extended method connects to the proxy instead of the given host, |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
132 | if a proxy is to be used. It throws an exception, if the proxy data |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
133 | is incomplete. |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
134 | |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
135 | @param host name of the FTP host (string) |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
136 | @param port port of the FTP host (integer) |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
137 | @param timeout timeout in seconds for blocking operations (integer) |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
138 | @return welcome message of the server (string) |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
139 | @exception E5FtpProxyError raised to indicate a proxy related issue |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
140 | """ |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
141 | if host: |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
142 | self.__host = host |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
143 | if port: |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
144 | self.__port = port |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
145 | if timeout != -999: |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
146 | self.__timeout = timeout |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
147 | |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
148 | if self.__proxyType != E5FtpProxyType.NoProxy: |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
149 | if not self.__proxyHost: |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
150 | raise E5FtpProxyError( |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
151 | "990 Proxy usage requested, but no proxy host given.") |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
152 | |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
153 | return super().connect(self.__proxyHost, self.__proxyPort, self.__timeout) |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
154 | else: |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
155 | return super().connect(self.__host, self.__port, self.__timeout) |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
156 | |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
157 | def login(self, user="", password="", acct=""): |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
158 | """ |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
159 | Public method to login to the FTP server. |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
160 | |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
161 | This extended method respects the FTP proxy configuration. There are many |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
162 | different FTP proxy products available. But unfortunately there is no |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
163 | standard for how o traverse a FTP proxy. The lis below shows the sequence |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
164 | of commands used. |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
165 | |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
166 | <table> |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
167 | <tr><td>user</td><td>Username for remote host</td></tr> |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
168 | <tr><td>pass</td><td>Password for remote host</td></tr> |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
169 | <tr><td>pruser</td><td>Username for FTP proxy</td></tr> |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
170 | <tr><td>prpass</td><td>Password for FTP proxy</td></tr> |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
171 | <tr><td>remote.host</td><td>Hostname of the remote FTP server</td></tr> |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
172 | </table> |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
173 | |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
174 | <dl> |
2077
68a34718a0ce
Made the first set of Qt5 compatibility changes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2074
diff
changeset
|
175 | <dt>E5FtpProxyType.NoProxy:</dt> |
2074
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
176 | <dd> |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
177 | USER user<br/> |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
178 | PASS pass |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
179 | </dd> |
2077
68a34718a0ce
Made the first set of Qt5 compatibility changes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2074
diff
changeset
|
180 | <dt>E5FtpProxyType.NonAuthorizing:</dt> |
2074
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
181 | <dd> |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
182 | USER user@remote.host<br/> |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
183 | PASS pass |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
184 | </dd> |
2077
68a34718a0ce
Made the first set of Qt5 compatibility changes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2074
diff
changeset
|
185 | <dt>E5FtpProxyType.UserAtServer:</dt> |
2074
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
186 | <dd> |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
187 | USER pruser<br/> |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
188 | PASS prpass<br/> |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
189 | USER user@remote.host<br/> |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
190 | PASS pass |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
191 | </dd> |
2077
68a34718a0ce
Made the first set of Qt5 compatibility changes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2074
diff
changeset
|
192 | <dt>E5FtpProxyType.Site:</dt> |
2074
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
193 | <dd> |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
194 | USER pruser<br/> |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
195 | PASS prpass<br/> |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
196 | SITE remote.site<br/> |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
197 | USER user<br/> |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
198 | PASS pass |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
199 | </dd> |
2077
68a34718a0ce
Made the first set of Qt5 compatibility changes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2074
diff
changeset
|
200 | <dt>E5FtpProxyType.Open:</dt> |
2074
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
201 | <dd> |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
202 | USER pruser<br/> |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
203 | PASS prpass<br/> |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
204 | OPEN remote.site<br/> |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
205 | USER user<br/> |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
206 | PASS pass |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
207 | </dd> |
2077
68a34718a0ce
Made the first set of Qt5 compatibility changes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2074
diff
changeset
|
208 | <dt>E5FtpProxyType.UserAtProxyuserAtServer:</dt> |
2074
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
209 | <dd> |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
210 | USER user@pruser@remote.host<br/> |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
211 | PASS pass@prpass |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
212 | </dd> |
2077
68a34718a0ce
Made the first set of Qt5 compatibility changes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2074
diff
changeset
|
213 | <dt>E5FtpProxyType.ProxyuserAtServer:</dt> |
2074
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
214 | <dd> |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
215 | USER pruser@remote.host<br/> |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
216 | PASS prpass<br/> |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
217 | USER user<br/> |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
218 | PASS pass |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
219 | </dd> |
2077
68a34718a0ce
Made the first set of Qt5 compatibility changes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2074
diff
changeset
|
220 | <dt>E5FtpProxyType.AuthResp:</dt> |
2074
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
221 | <dd> |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
222 | USER user@remote.host<br/> |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
223 | PASS pass<br/> |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
224 | AUTH pruser<br/> |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
225 | RESP prpass |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
226 | </dd> |
2077
68a34718a0ce
Made the first set of Qt5 compatibility changes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2074
diff
changeset
|
227 | <dt>E5FtpProxyType.Bluecoat:</dt> |
2074
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
228 | <dd> |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
229 | USER user@remote.host pruser<br/> |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
230 | PASS pass<br/> |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
231 | ACCT prpass |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
232 | </dd> |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
233 | </dl> |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
234 | |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
235 | @param user username for the remote host (string) |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
236 | @param password password for the remote host (string) |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
237 | @param acct accounting information for the remote host (string) |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
238 | @return response sent by the remote host (string) |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
239 | @exception E5FtpProxyError raised to indicate a proxy related issue |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
240 | """ |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
241 | if not user: |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
242 | user = "anonymous" |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
243 | if not password: |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
244 | # make sure it is a string |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
245 | password = "" |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
246 | if not acct: |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
247 | # make sure it is a string |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
248 | acct = "" |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
249 | if user == "anonymous" and password in {'', '-'}: |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
250 | password += "anonymous@" |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
251 | |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
252 | if self.__proxyType != E5FtpProxyType.NoProxy: |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
253 | if self.__proxyType != E5FtpProxyType.NonAuthorizing: |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
254 | # check, if a valid proxy configuration is known |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
255 | if not self.__proxyUser: |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
256 | raise E5FtpProxyError( |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
257 | "991 Proxy usage requested, but no proxy user given") |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
258 | if not self.__proxyPassword: |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
259 | raise E5FtpProxyError( |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
260 | "992 Proxy usage requested, but no proxy password given") |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
261 | |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
262 | if self.__proxyType in [E5FtpProxyType.NonAuthorizing, |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
263 | E5FtpProxyType.AuthResp, E5FtpProxyType.Bluecoat]: |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
264 | user += "@" + self.__host |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
265 | if self.__proxyType == E5FtpProxyType.Bluecoat: |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
266 | user += " " + self.__proxyUser |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
267 | acct = self.__proxyPassword |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
268 | elif self.__proxyType == E5FtpProxyType.UserAtProxyuserAtServer: |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
269 | user = "{0}@{1}@{2}".format(user, self.__proxyUser, self.__host) |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
270 | password = "{0}@{1}".format(password, self.__proxyPassword) |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
271 | else: |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
272 | pruser = self.__proxyUser |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
273 | if self.__proxyType == E5FtpProxyType.UserAtServer: |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
274 | user += "@" + self.__host |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
275 | elif self.__proxyType == E5FtpProxyType.ProxyuserAtServer: |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
276 | pruser += "@" + self.__host |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
277 | |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
278 | # authenticate to the proxy first |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
279 | presp = self.sendcmd("USER " + pruser) |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
280 | if presp[0] == "3": |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
281 | presp = self.sendcmd("PASS " + self.__proxyPassword) |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
282 | if presp[0] == "3" and self.__proxyAccount: |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
283 | presp = self.sendcmd("ACCT " + self.__proxyAccount) |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
284 | if presp[0] != "2": |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
285 | raise E5FtpProxyError("9{0}0 Error authorizing at proxy\n{1}".format( |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
286 | presp[0], presp)) |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
287 | |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
288 | if self.__proxyType == E5FtpProxyType.Site: |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
289 | # send SITE command |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
290 | presp = self.sendcmd("SITE " + self.__host) |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
291 | if presp[0] != "2": |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
292 | raise E5FtpProxyError( |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
293 | "9{0}0 Error sending SITE command\n{1}".format( |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
294 | presp[0], presp)) |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
295 | elif self.__proxyType == E5FtpProxyType.Open: |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
296 | # send OPEN command |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
297 | presp = self.sendcmd("OPEN " + self.__host) |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
298 | if presp[0] != "2": |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
299 | raise E5FtpProxyError( |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
300 | "9{0}0 Error sending OPEN command\n{1}".format( |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
301 | presp[0], presp)) |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
302 | |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
303 | # authenticate to the remote host or combined to proxy and remote host |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
304 | resp = self.sendcmd("USER " + user) |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
305 | if resp[0] == "3": |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
306 | resp = self.sendcmd("PASS " + password) |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
307 | if resp[0] == "3": |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
308 | resp = self.sendcmd("ACCT " + acct) |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
309 | if resp[0] != "2": |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
310 | raise ftplib.error_reply(resp) |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
311 | |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
312 | if self.__proxyType == E5FtpProxyType.AuthResp: |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
313 | # authorize to the FTP proxy |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
314 | presp = self.sendcmd("AUTH " + self.__proxyUser) |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
315 | if presp[0] == "3": |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
316 | presp = self.sendcmd("RESP " + self.__proxyPassword) |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
317 | if presp[0] != "2": |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
318 | raise E5FtpProxyError("9{0}0 Error authorizing at proxy\n{1}".format( |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
319 | presp[0], presp)) |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
320 | |
5cb87968aad5
Reworked the FTP stuff to support a bunch of different FTP proxy types. Unfortunately FTP proxy support is not standardized.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
321 | return resp |