|
1 <!DOCTYPE html> |
|
2 <html><head> |
|
3 <title>eric7.EricNetwork.EricFtp</title> |
|
4 <meta charset="UTF-8"> |
|
5 <link rel="stylesheet" href="styles.css"> |
|
6 </head> |
|
7 <body> |
|
8 <a NAME="top" ID="top"></a> |
|
9 <h1>eric7.EricNetwork.EricFtp</h1> |
|
10 |
|
11 <p> |
|
12 Module implementing an extension to the Python FTP class to support FTP |
|
13 proxies. |
|
14 </p> |
|
15 <h3>Global Attributes</h3> |
|
16 |
|
17 <table> |
|
18 <tr><td>None</td></tr> |
|
19 </table> |
|
20 <h3>Classes</h3> |
|
21 |
|
22 <table> |
|
23 |
|
24 <tr> |
|
25 <td><a href="#EricFtp">EricFtp</a></td> |
|
26 <td>Class implementing an extension to the Python FTP class to support FTP proxies.</td> |
|
27 </tr> |
|
28 <tr> |
|
29 <td><a href="#EricFtpProxyError">EricFtpProxyError</a></td> |
|
30 <td>Class to signal an error related to proxy configuration.</td> |
|
31 </tr> |
|
32 <tr> |
|
33 <td><a href="#EricFtpProxyType">EricFtpProxyType</a></td> |
|
34 <td>Class defining the supported FTP proxy types.</td> |
|
35 </tr> |
|
36 </table> |
|
37 <h3>Functions</h3> |
|
38 |
|
39 <table> |
|
40 <tr><td>None</td></tr> |
|
41 </table> |
|
42 <hr /> |
|
43 <hr /> |
|
44 <a NAME="EricFtp" ID="EricFtp"></a> |
|
45 <h2>EricFtp</h2> |
|
46 |
|
47 <p> |
|
48 Class implementing an extension to the Python FTP class to support FTP |
|
49 proxies. |
|
50 </p> |
|
51 <h3>Derived from</h3> |
|
52 ftplib.FTP |
|
53 <h3>Class Attributes</h3> |
|
54 |
|
55 <table> |
|
56 <tr><td>None</td></tr> |
|
57 </table> |
|
58 <h3>Class Methods</h3> |
|
59 |
|
60 <table> |
|
61 <tr><td>None</td></tr> |
|
62 </table> |
|
63 <h3>Methods</h3> |
|
64 |
|
65 <table> |
|
66 |
|
67 <tr> |
|
68 <td><a href="#EricFtp.__init__">EricFtp</a></td> |
|
69 <td>Constructor</td> |
|
70 </tr> |
|
71 <tr> |
|
72 <td><a href="#EricFtp.connect">connect</a></td> |
|
73 <td>Public method to connect to the given FTP server.</td> |
|
74 </tr> |
|
75 <tr> |
|
76 <td><a href="#EricFtp.login">login</a></td> |
|
77 <td></td> |
|
78 </tr> |
|
79 <tr> |
|
80 <td><a href="#EricFtp.setProxy">setProxy</a></td> |
|
81 <td>Public method to set the proxy configuration.</td> |
|
82 </tr> |
|
83 <tr> |
|
84 <td><a href="#EricFtp.setProxyAuthentication">setProxyAuthentication</a></td> |
|
85 <td>Public method to set the proxy authentication info.</td> |
|
86 </tr> |
|
87 </table> |
|
88 <h3>Static Methods</h3> |
|
89 |
|
90 <table> |
|
91 <tr><td>None</td></tr> |
|
92 </table> |
|
93 |
|
94 <a NAME="EricFtp.__init__" ID="EricFtp.__init__"></a> |
|
95 <h4>EricFtp (Constructor)</h4> |
|
96 <b>EricFtp</b>(<i>host="", user="", password="", acct="", proxyType=EricFtpProxyType.NO_PROXY, proxyHost="", proxyPort=ftplib.FTP_PORT, proxyUser="", proxyPassword="", proxyAccount="", timeout=_GLOBAL_DEFAULT_TIMEOUT</i>) |
|
97 |
|
98 <p> |
|
99 Constructor |
|
100 </p> |
|
101 <dl> |
|
102 |
|
103 <dt><i>host</i> (str)</dt> |
|
104 <dd> |
|
105 name of the FTP host |
|
106 </dd> |
|
107 <dt><i>user</i> (str)</dt> |
|
108 <dd> |
|
109 user name for login to FTP host |
|
110 </dd> |
|
111 <dt><i>password</i> (str)</dt> |
|
112 <dd> |
|
113 password for login to FTP host |
|
114 </dd> |
|
115 <dt><i>acct</i> (str)</dt> |
|
116 <dd> |
|
117 account for login to FTP host |
|
118 </dd> |
|
119 <dt><i>proxyType</i> (EricFtpProxyType)</dt> |
|
120 <dd> |
|
121 type of the FTP proxy |
|
122 </dd> |
|
123 <dt><i>proxyHost</i> (str)</dt> |
|
124 <dd> |
|
125 name of the FTP proxy |
|
126 </dd> |
|
127 <dt><i>proxyPort</i> (int)</dt> |
|
128 <dd> |
|
129 port of the FTP proxy |
|
130 </dd> |
|
131 <dt><i>proxyUser</i> (str)</dt> |
|
132 <dd> |
|
133 user name for login to the proxy |
|
134 </dd> |
|
135 <dt><i>proxyPassword</i> (str)</dt> |
|
136 <dd> |
|
137 password for login to the proxy |
|
138 </dd> |
|
139 <dt><i>proxyAccount</i> (str)</dt> |
|
140 <dd> |
|
141 accounting info for the proxy |
|
142 </dd> |
|
143 <dt><i>timeout</i> (int)</dt> |
|
144 <dd> |
|
145 timeout in seconds for blocking operations |
|
146 </dd> |
|
147 </dl> |
|
148 <a NAME="EricFtp.connect" ID="EricFtp.connect"></a> |
|
149 <h4>EricFtp.connect</h4> |
|
150 <b>connect</b>(<i>host="", port=0, timeout=-999</i>) |
|
151 |
|
152 <p> |
|
153 Public method to connect to the given FTP server. |
|
154 </p> |
|
155 <p> |
|
156 This extended method connects to the proxy instead of the given host, |
|
157 if a proxy is to be used. It throws an exception, if the proxy data |
|
158 is incomplete. |
|
159 </p> |
|
160 <dl> |
|
161 |
|
162 <dt><i>host</i> (str)</dt> |
|
163 <dd> |
|
164 name of the FTP host |
|
165 </dd> |
|
166 <dt><i>port</i> (int)</dt> |
|
167 <dd> |
|
168 port of the FTP host |
|
169 </dd> |
|
170 <dt><i>timeout</i> (int)</dt> |
|
171 <dd> |
|
172 timeout in seconds for blocking operations |
|
173 </dd> |
|
174 </dl> |
|
175 <dl> |
|
176 <dt>Return:</dt> |
|
177 <dd> |
|
178 welcome message of the server |
|
179 </dd> |
|
180 </dl> |
|
181 <dl> |
|
182 <dt>Return Type:</dt> |
|
183 <dd> |
|
184 str |
|
185 </dd> |
|
186 </dl> |
|
187 <dl> |
|
188 |
|
189 <dt>Raises <b>EricFtpProxyError</b>:</dt> |
|
190 <dd> |
|
191 raised to indicate a proxy related issue |
|
192 </dd> |
|
193 </dl> |
|
194 <a NAME="EricFtp.login" ID="EricFtp.login"></a> |
|
195 <h4>EricFtp.login</h4> |
|
196 <b>login</b>(<i>user="", password="", acct=""</i>) |
|
197 |
|
198 <a NAME="EricFtp.setProxy" ID="EricFtp.setProxy"></a> |
|
199 <h4>EricFtp.setProxy</h4> |
|
200 <b>setProxy</b>(<i>proxyType=EricFtpProxyType.NO_PROXY, proxyHost="", proxyPort=ftplib.FTP_PORT, proxyUser="", proxyPassword="", proxyAccount=""</i>) |
|
201 |
|
202 <p> |
|
203 Public method to set the proxy configuration. |
|
204 </p> |
|
205 <dl> |
|
206 |
|
207 <dt><i>proxyType</i> (EricFtpProxyType)</dt> |
|
208 <dd> |
|
209 type of the FTP proxy |
|
210 </dd> |
|
211 <dt><i>proxyHost</i> (str)</dt> |
|
212 <dd> |
|
213 name of the FTP proxy |
|
214 </dd> |
|
215 <dt><i>proxyPort</i> (int)</dt> |
|
216 <dd> |
|
217 port of the FTP proxy |
|
218 </dd> |
|
219 <dt><i>proxyUser</i> (str)</dt> |
|
220 <dd> |
|
221 user name for login to the proxy |
|
222 </dd> |
|
223 <dt><i>proxyPassword</i> (str)</dt> |
|
224 <dd> |
|
225 password for login to the proxy |
|
226 </dd> |
|
227 <dt><i>proxyAccount</i> (str)</dt> |
|
228 <dd> |
|
229 accounting info for the proxy |
|
230 </dd> |
|
231 </dl> |
|
232 <a NAME="EricFtp.setProxyAuthentication" ID="EricFtp.setProxyAuthentication"></a> |
|
233 <h4>EricFtp.setProxyAuthentication</h4> |
|
234 <b>setProxyAuthentication</b>(<i>proxyUser="", proxyPassword="", proxyAccount=""</i>) |
|
235 |
|
236 <p> |
|
237 Public method to set the proxy authentication info. |
|
238 </p> |
|
239 <dl> |
|
240 |
|
241 <dt><i>proxyUser</i> (str)</dt> |
|
242 <dd> |
|
243 user name for login to the proxy |
|
244 </dd> |
|
245 <dt><i>proxyPassword</i> (str)</dt> |
|
246 <dd> |
|
247 password for login to the proxy |
|
248 </dd> |
|
249 <dt><i>proxyAccount</i> (str)</dt> |
|
250 <dd> |
|
251 accounting info for the proxy |
|
252 </dd> |
|
253 </dl> |
|
254 <div align="right"><a href="#top">Up</a></div> |
|
255 <hr /> |
|
256 <hr /> |
|
257 <a NAME="EricFtpProxyError" ID="EricFtpProxyError"></a> |
|
258 <h2>EricFtpProxyError</h2> |
|
259 |
|
260 <p> |
|
261 Class to signal an error related to proxy configuration. |
|
262 </p> |
|
263 <p> |
|
264 The error message starts with a three digit error code followed by a |
|
265 space and the error string. Supported error codes are: |
|
266 <ul> |
|
267 <li>910: proxy error; the second number gives the category of the proxy |
|
268 error. The original response from the proxy is appended in the next |
|
269 line.</li> |
|
270 <li>930: proxy error; the second number gives the category of the proxy |
|
271 error. The original response from the proxy is appended in the next |
|
272 line.</li> |
|
273 <li>940: proxy error; the second number gives the category of the proxy |
|
274 error. The original response from the proxy is appended in the next |
|
275 line.</li> |
|
276 <li>950: proxy error; the second number gives the category of the proxy |
|
277 error. The original response from the proxy is appended in the next |
|
278 line.</li> |
|
279 <li>990: proxy usage is enabled but no proxy host given</li> |
|
280 <li>991: proxy usage is enabled but no proxy user given</li> |
|
281 <li>992: proxy usage is enabled but no proxy password given</li> |
|
282 </ul> |
|
283 </p> |
|
284 <h3>Derived from</h3> |
|
285 ftplib.Error |
|
286 <h3>Class Attributes</h3> |
|
287 |
|
288 <table> |
|
289 <tr><td>None</td></tr> |
|
290 </table> |
|
291 <h3>Class Methods</h3> |
|
292 |
|
293 <table> |
|
294 <tr><td>None</td></tr> |
|
295 </table> |
|
296 <h3>Methods</h3> |
|
297 |
|
298 <table> |
|
299 <tr><td>None</td></tr> |
|
300 </table> |
|
301 <h3>Static Methods</h3> |
|
302 |
|
303 <table> |
|
304 <tr><td>None</td></tr> |
|
305 </table> |
|
306 |
|
307 <div align="right"><a href="#top">Up</a></div> |
|
308 <hr /> |
|
309 <hr /> |
|
310 <a NAME="EricFtpProxyType" ID="EricFtpProxyType"></a> |
|
311 <h2>EricFtpProxyType</h2> |
|
312 |
|
313 <p> |
|
314 Class defining the supported FTP proxy types. |
|
315 </p> |
|
316 <h3>Derived from</h3> |
|
317 enum.Enum |
|
318 <h3>Class Attributes</h3> |
|
319 |
|
320 <table> |
|
321 <tr><td>AUTH_RESP</td></tr><tr><td>BLUECOAT</td></tr><tr><td>NON_AUTHORIZING</td></tr><tr><td>NO_PROXY</td></tr><tr><td>OPEN</td></tr><tr><td>PROXYUSER_SERVER</td></tr><tr><td>SITE</td></tr><tr><td>USER_PROXYUSER_SERVER</td></tr><tr><td>USER_SERVER</td></tr> |
|
322 </table> |
|
323 <h3>Class Methods</h3> |
|
324 |
|
325 <table> |
|
326 <tr><td>None</td></tr> |
|
327 </table> |
|
328 <h3>Methods</h3> |
|
329 |
|
330 <table> |
|
331 <tr><td>None</td></tr> |
|
332 </table> |
|
333 <h3>Static Methods</h3> |
|
334 |
|
335 <table> |
|
336 <tr><td>None</td></tr> |
|
337 </table> |
|
338 |
|
339 <div align="right"><a href="#top">Up</a></div> |
|
340 <hr /> |
|
341 </body></html> |