eric6/Documentation/Source/eric6.E5Network.E5Ftp.html

branch
maintenance
changeset 7286
7eb04391adf7
parent 7273
391d6b7b1eff
child 7631
2c7ccb4484bf
equal deleted inserted replaced
7226:babe80d84a3e 7286:7eb04391adf7
16 16
17 a { color: #BA6D36; } 17 a { color: #BA6D36; }
18 18
19 </style> 19 </style>
20 </head> 20 </head>
21 <body><a NAME="top" ID="top"></a> 21 <body>
22 <a NAME="top" ID="top"></a>
22 <h1>eric6.E5Network.E5Ftp</h1> 23 <h1>eric6.E5Network.E5Ftp</h1>
24
23 <p> 25 <p>
24 Module implementing an extension to the Python FTP class to support FTP 26 Module implementing an extension to the Python FTP class to support FTP
25 proxies. 27 proxies.
26 </p> 28 </p>
27 <h3>Global Attributes</h3> 29 <h3>Global Attributes</h3>
30
28 <table> 31 <table>
29 <tr><td>None</td></tr> 32 <tr><td>None</td></tr>
30 </table> 33 </table>
31 <h3>Classes</h3> 34 <h3>Classes</h3>
32 <table> 35
36 <table>
37
33 <tr> 38 <tr>
34 <td><a href="#E5Ftp">E5Ftp</a></td> 39 <td><a href="#E5Ftp">E5Ftp</a></td>
35 <td>Class implementing an extension to the Python FTP class to support FTP proxies.</td> 40 <td>Class implementing an extension to the Python FTP class to support FTP proxies.</td>
36 </tr><tr> 41 </tr>
42 <tr>
37 <td><a href="#E5FtpProxyError">E5FtpProxyError</a></td> 43 <td><a href="#E5FtpProxyError">E5FtpProxyError</a></td>
38 <td>Class to signal an error related to proxy configuration.</td> 44 <td>Class to signal an error related to proxy configuration.</td>
39 </tr><tr> 45 </tr>
46 <tr>
40 <td><a href="#E5FtpProxyType">E5FtpProxyType</a></td> 47 <td><a href="#E5FtpProxyType">E5FtpProxyType</a></td>
41 <td>Class defining the supported FTP proxy types.</td> 48 <td>Class defining the supported FTP proxy types.</td>
42 </tr> 49 </tr>
43 </table> 50 </table>
44 <h3>Functions</h3> 51 <h3>Functions</h3>
45 <table> 52
46 <tr><td>None</td></tr> 53 <table>
47 </table> 54 <tr><td>None</td></tr>
48 <hr /><hr /> 55 </table>
56 <hr />
57 <hr />
49 <a NAME="E5Ftp" ID="E5Ftp"></a> 58 <a NAME="E5Ftp" ID="E5Ftp"></a>
50 <h2>E5Ftp</h2> 59 <h2>E5Ftp</h2>
60
51 <p> 61 <p>
52 Class implementing an extension to the Python FTP class to support FTP 62 Class implementing an extension to the Python FTP class to support FTP
53 proxies. 63 proxies.
54 </p> 64 </p>
55 <h3>Derived from</h3> 65 <h3>Derived from</h3>
56 ftplib.FTP 66 ftplib.FTP
57 <h3>Class Attributes</h3> 67 <h3>Class Attributes</h3>
68
58 <table> 69 <table>
59 <tr><td>None</td></tr> 70 <tr><td>None</td></tr>
60 </table> 71 </table>
61 <h3>Class Methods</h3> 72 <h3>Class Methods</h3>
73
62 <table> 74 <table>
63 <tr><td>None</td></tr> 75 <tr><td>None</td></tr>
64 </table> 76 </table>
65 <h3>Methods</h3> 77 <h3>Methods</h3>
66 <table> 78
79 <table>
80
67 <tr> 81 <tr>
68 <td><a href="#E5Ftp.__init__">E5Ftp</a></td> 82 <td><a href="#E5Ftp.__init__">E5Ftp</a></td>
69 <td>Constructor</td> 83 <td>Constructor</td>
70 </tr><tr> 84 </tr>
85 <tr>
71 <td><a href="#E5Ftp.connect">connect</a></td> 86 <td><a href="#E5Ftp.connect">connect</a></td>
72 <td>Public method to connect to the given FTP server.</td> 87 <td>Public method to connect to the given FTP server.</td>
73 </tr><tr> 88 </tr>
89 <tr>
74 <td><a href="#E5Ftp.login">login</a></td> 90 <td><a href="#E5Ftp.login">login</a></td>
75 <td>Public method to login to the FTP server.</td> 91 <td>Public method to login to the FTP server.</td>
76 </tr><tr> 92 </tr>
93 <tr>
77 <td><a href="#E5Ftp.setProxy">setProxy</a></td> 94 <td><a href="#E5Ftp.setProxy">setProxy</a></td>
78 <td>Public method to set the proxy configuration.</td> 95 <td>Public method to set the proxy configuration.</td>
79 </tr><tr> 96 </tr>
97 <tr>
80 <td><a href="#E5Ftp.setProxyAuthentication">setProxyAuthentication</a></td> 98 <td><a href="#E5Ftp.setProxyAuthentication">setProxyAuthentication</a></td>
81 <td>Public method to set the proxy authentication info.</td> 99 <td>Public method to set the proxy authentication info.</td>
82 </tr> 100 </tr>
83 </table> 101 </table>
84 <h3>Static Methods</h3> 102 <h3>Static Methods</h3>
85 <table> 103
86 <tr><td>None</td></tr> 104 <table>
87 </table> 105 <tr><td>None</td></tr>
106 </table>
107
88 <a NAME="E5Ftp.__init__" ID="E5Ftp.__init__"></a> 108 <a NAME="E5Ftp.__init__" ID="E5Ftp.__init__"></a>
89 <h4>E5Ftp (Constructor)</h4> 109 <h4>E5Ftp (Constructor)</h4>
90 <b>E5Ftp</b>(<i>host="", user="", password="", acct="", proxyType=E5FtpProxyType.NoProxy, proxyHost="", proxyPort=ftplib.FTP_PORT, proxyUser="", proxyPassword="", proxyAccount="", timeout=_GLOBAL_DEFAULT_TIMEOUT</i>) 110 <b>E5Ftp</b>(<i>host="", user="", password="", acct="", proxyType=E5FtpProxyType.NoProxy, proxyHost="", proxyPort=ftplib.FTP_PORT, proxyUser="", proxyPassword="", proxyAccount="", timeout=_GLOBAL_DEFAULT_TIMEOUT</i>)
111
91 <p> 112 <p>
92 Constructor 113 Constructor
93 </p><dl> 114 </p>
115 <dl>
116
94 <dt><i>host</i></dt> 117 <dt><i>host</i></dt>
95 <dd> 118 <dd>
96 name of the FTP host (string) 119 name of the FTP host (string)
97 </dd><dt><i>user</i></dt> 120 </dd>
121 <dt><i>user</i></dt>
98 <dd> 122 <dd>
99 user name for login to FTP host (string) 123 user name for login to FTP host (string)
100 </dd><dt><i>password</i></dt> 124 </dd>
125 <dt><i>password</i></dt>
101 <dd> 126 <dd>
102 password for login to FTP host (string) 127 password for login to FTP host (string)
103 </dd><dt><i>acct</i></dt> 128 </dd>
129 <dt><i>acct</i></dt>
104 <dd> 130 <dd>
105 account for login to FTP host (string) 131 account for login to FTP host (string)
106 </dd><dt><i>proxyType</i></dt> 132 </dd>
133 <dt><i>proxyType</i></dt>
107 <dd> 134 <dd>
108 type of the FTP proxy (integer 0 to 8) 135 type of the FTP proxy (integer 0 to 8)
109 </dd><dt><i>proxyHost</i></dt> 136 </dd>
137 <dt><i>proxyHost</i></dt>
110 <dd> 138 <dd>
111 name of the FTP proxy (string) 139 name of the FTP proxy (string)
112 </dd><dt><i>proxyPort</i></dt> 140 </dd>
141 <dt><i>proxyPort</i></dt>
113 <dd> 142 <dd>
114 port of the FTP proxy (integer) 143 port of the FTP proxy (integer)
115 </dd><dt><i>proxyUser</i></dt> 144 </dd>
145 <dt><i>proxyUser</i></dt>
116 <dd> 146 <dd>
117 user name for login to the proxy (string) 147 user name for login to the proxy (string)
118 </dd><dt><i>proxyPassword</i></dt> 148 </dd>
149 <dt><i>proxyPassword</i></dt>
119 <dd> 150 <dd>
120 password for login to the proxy (string) 151 password for login to the proxy (string)
121 </dd><dt><i>proxyAccount</i></dt> 152 </dd>
153 <dt><i>proxyAccount</i></dt>
122 <dd> 154 <dd>
123 accounting info for the proxy (string) 155 accounting info for the proxy (string)
124 </dd><dt><i>timeout</i></dt> 156 </dd>
157 <dt><i>timeout</i></dt>
125 <dd> 158 <dd>
126 timeout in seconds for blocking operations (integer) 159 timeout in seconds for blocking operations (integer)
127 </dd> 160 </dd>
128 </dl><a NAME="E5Ftp.connect" ID="E5Ftp.connect"></a> 161 </dl>
162 <a NAME="E5Ftp.connect" ID="E5Ftp.connect"></a>
129 <h4>E5Ftp.connect</h4> 163 <h4>E5Ftp.connect</h4>
130 <b>connect</b>(<i>host="", port=0, timeout=-999</i>) 164 <b>connect</b>(<i>host="", port=0, timeout=-999</i>)
165
131 <p> 166 <p>
132 Public method to connect to the given FTP server. 167 Public method to connect to the given FTP server.
133 </p><p> 168 </p>
169 <p>
134 This extended method connects to the proxy instead of the given host, 170 This extended method connects to the proxy instead of the given host,
135 if a proxy is to be used. It throws an exception, if the proxy data 171 if a proxy is to be used. It throws an exception, if the proxy data
136 is incomplete. 172 is incomplete.
137 </p><dl> 173 </p>
174 <dl>
175
138 <dt><i>host</i></dt> 176 <dt><i>host</i></dt>
139 <dd> 177 <dd>
140 name of the FTP host (string) 178 name of the FTP host (string)
141 </dd><dt><i>port</i></dt> 179 </dd>
180 <dt><i>port</i></dt>
142 <dd> 181 <dd>
143 port of the FTP host (integer) 182 port of the FTP host (integer)
144 </dd><dt><i>timeout</i></dt> 183 </dd>
184 <dt><i>timeout</i></dt>
145 <dd> 185 <dd>
146 timeout in seconds for blocking operations (integer) 186 timeout in seconds for blocking operations (integer)
147 </dd> 187 </dd>
148 </dl><dl> 188 </dl>
189 <dl>
149 <dt>Returns:</dt> 190 <dt>Returns:</dt>
150 <dd> 191 <dd>
151 welcome message of the server (string) 192 welcome message of the server (string)
152 </dd> 193 </dd>
153 </dl><dl> 194 </dl>
195 <dl>
196
154 <dt>Raises <b>E5FtpProxyError</b>:</dt> 197 <dt>Raises <b>E5FtpProxyError</b>:</dt>
155 <dd> 198 <dd>
156 raised to indicate a proxy related issue 199 raised to indicate a proxy related issue
157 </dd> 200 </dd>
158 </dl><a NAME="E5Ftp.login" ID="E5Ftp.login"></a> 201 </dl>
202 <a NAME="E5Ftp.login" ID="E5Ftp.login"></a>
159 <h4>E5Ftp.login</h4> 203 <h4>E5Ftp.login</h4>
160 <b>login</b>(<i>user="", password="", acct=""</i>) 204 <b>login</b>(<i>user="", password="", acct=""</i>)
205
161 <p> 206 <p>
162 Public method to login to the FTP server. 207 Public method to login to the FTP server.
163 </p><p> 208 </p>
209 <p>
164 This extended method respects the FTP proxy configuration. There are 210 This extended method respects the FTP proxy configuration. There are
165 many different FTP proxy products available. But unfortunately there 211 many different FTP proxy products available. But unfortunately there
166 is no standard for how o traverse a FTP proxy. The lis below shows 212 is no standard for how o traverse a FTP proxy. The lis below shows
167 the sequence of commands used. 213 the sequence of commands used.
168 </p><p> 214 </p>
215 <p>
169 <table> 216 <table>
170 <tr><td>user</td><td>Username for remote host</td></tr> 217 <tr><td>user</td><td>Username for remote host</td></tr>
171 <tr><td>pass</td><td>Password for remote host</td></tr> 218 <tr><td>pass</td><td>Password for remote host</td></tr>
172 <tr><td>pruser</td><td>Username for FTP proxy</td></tr> 219 <tr><td>pruser</td><td>Username for FTP proxy</td></tr>
173 <tr><td>prpass</td><td>Password for FTP proxy</td></tr> 220 <tr><td>prpass</td><td>Password for FTP proxy</td></tr>
174 <tr><td>remote.host</td><td>Hostname of the remote FTP server</td> 221 <tr><td>remote.host</td><td>Hostname of the remote FTP server</td>
175 </tr> 222 </tr>
176 </table> 223 </table>
177 </p><p> 224 </p>
225 <p>
178 <dl> 226 <dl>
179 <dt>E5FtpProxyType.NoProxy:</dt> 227 <dt>E5FtpProxyType.NoProxy:</dt>
180 <dd> 228 <dd>
181 USER user<br/> 229 USER user<br/>
182 PASS pass 230 PASS pass
233 USER user@remote.host pruser<br/> 281 USER user@remote.host pruser<br/>
234 PASS pass<br/> 282 PASS pass<br/>
235 ACCT prpass 283 ACCT prpass
236 </dd> 284 </dd>
237 </dl> 285 </dl>
238 </p><dl> 286 </p>
287 <dl>
288
239 <dt><i>user</i></dt> 289 <dt><i>user</i></dt>
240 <dd> 290 <dd>
241 username for the remote host (string) 291 username for the remote host (string)
242 </dd><dt><i>password</i></dt> 292 </dd>
293 <dt><i>password</i></dt>
243 <dd> 294 <dd>
244 password for the remote host (string) 295 password for the remote host (string)
245 </dd><dt><i>acct</i></dt> 296 </dd>
297 <dt><i>acct</i></dt>
246 <dd> 298 <dd>
247 accounting information for the remote host (string) 299 accounting information for the remote host (string)
248 </dd> 300 </dd>
249 </dl><dl> 301 </dl>
302 <dl>
250 <dt>Returns:</dt> 303 <dt>Returns:</dt>
251 <dd> 304 <dd>
252 response sent by the remote host (string) 305 response sent by the remote host (string)
253 </dd> 306 </dd>
254 </dl><dl> 307 </dl>
308 <dl>
309
255 <dt>Raises <b>E5FtpProxyError</b>:</dt> 310 <dt>Raises <b>E5FtpProxyError</b>:</dt>
256 <dd> 311 <dd>
257 raised to indicate a proxy related issue 312 raised to indicate a proxy related issue
258 </dd><dt>Raises <b>ftplib.error_reply</b>:</dt> 313 </dd>
314 <dt>Raises <b>ftplib.error_reply</b>:</dt>
259 <dd> 315 <dd>
260 raised to indicate an FTP error reply 316 raised to indicate an FTP error reply
261 </dd> 317 </dd>
262 </dl><a NAME="E5Ftp.setProxy" ID="E5Ftp.setProxy"></a> 318 </dl>
319 <a NAME="E5Ftp.setProxy" ID="E5Ftp.setProxy"></a>
263 <h4>E5Ftp.setProxy</h4> 320 <h4>E5Ftp.setProxy</h4>
264 <b>setProxy</b>(<i>proxyType=E5FtpProxyType.NoProxy, proxyHost="", proxyPort=ftplib.FTP_PORT, proxyUser="", proxyPassword="", proxyAccount=""</i>) 321 <b>setProxy</b>(<i>proxyType=E5FtpProxyType.NoProxy, proxyHost="", proxyPort=ftplib.FTP_PORT, proxyUser="", proxyPassword="", proxyAccount=""</i>)
322
265 <p> 323 <p>
266 Public method to set the proxy configuration. 324 Public method to set the proxy configuration.
267 </p><dl> 325 </p>
326 <dl>
327
268 <dt><i>proxyType</i></dt> 328 <dt><i>proxyType</i></dt>
269 <dd> 329 <dd>
270 type of the FTP proxy (integer 0 to 8) 330 type of the FTP proxy (integer 0 to 8)
271 </dd><dt><i>proxyHost</i></dt> 331 </dd>
332 <dt><i>proxyHost</i></dt>
272 <dd> 333 <dd>
273 name of the FTP proxy (string) 334 name of the FTP proxy (string)
274 </dd><dt><i>proxyPort</i></dt> 335 </dd>
336 <dt><i>proxyPort</i></dt>
275 <dd> 337 <dd>
276 port of the FTP proxy (integer) 338 port of the FTP proxy (integer)
277 </dd><dt><i>proxyUser</i></dt> 339 </dd>
340 <dt><i>proxyUser</i></dt>
278 <dd> 341 <dd>
279 user name for login to the proxy (string) 342 user name for login to the proxy (string)
280 </dd><dt><i>proxyPassword</i></dt> 343 </dd>
344 <dt><i>proxyPassword</i></dt>
281 <dd> 345 <dd>
282 password for login to the proxy (string) 346 password for login to the proxy (string)
283 </dd><dt><i>proxyAccount</i></dt> 347 </dd>
348 <dt><i>proxyAccount</i></dt>
284 <dd> 349 <dd>
285 accounting info for the proxy (string) 350 accounting info for the proxy (string)
286 </dd> 351 </dd>
287 </dl><a NAME="E5Ftp.setProxyAuthentication" ID="E5Ftp.setProxyAuthentication"></a> 352 </dl>
353 <a NAME="E5Ftp.setProxyAuthentication" ID="E5Ftp.setProxyAuthentication"></a>
288 <h4>E5Ftp.setProxyAuthentication</h4> 354 <h4>E5Ftp.setProxyAuthentication</h4>
289 <b>setProxyAuthentication</b>(<i>proxyUser="", proxyPassword="", proxyAccount=""</i>) 355 <b>setProxyAuthentication</b>(<i>proxyUser="", proxyPassword="", proxyAccount=""</i>)
356
290 <p> 357 <p>
291 Public method to set the proxy authentication info. 358 Public method to set the proxy authentication info.
292 </p><dl> 359 </p>
360 <dl>
361
293 <dt><i>proxyUser</i></dt> 362 <dt><i>proxyUser</i></dt>
294 <dd> 363 <dd>
295 user name for login to the proxy (string) 364 user name for login to the proxy (string)
296 </dd><dt><i>proxyPassword</i></dt> 365 </dd>
366 <dt><i>proxyPassword</i></dt>
297 <dd> 367 <dd>
298 password for login to the proxy (string) 368 password for login to the proxy (string)
299 </dd><dt><i>proxyAccount</i></dt> 369 </dd>
370 <dt><i>proxyAccount</i></dt>
300 <dd> 371 <dd>
301 accounting info for the proxy (string) 372 accounting info for the proxy (string)
302 </dd> 373 </dd>
303 </dl> 374 </dl>
304 <div align="right"><a href="#top">Up</a></div> 375 <div align="right"><a href="#top">Up</a></div>
305 <hr /><hr /> 376 <hr />
377 <hr />
306 <a NAME="E5FtpProxyError" ID="E5FtpProxyError"></a> 378 <a NAME="E5FtpProxyError" ID="E5FtpProxyError"></a>
307 <h2>E5FtpProxyError</h2> 379 <h2>E5FtpProxyError</h2>
380
308 <p> 381 <p>
309 Class to signal an error related to proxy configuration. 382 Class to signal an error related to proxy configuration.
310 </p><p> 383 </p>
384 <p>
311 The error message starts with a three digit error code followed by a 385 The error message starts with a three digit error code followed by a
312 space and the error string. Supported error codes are: 386 space and the error string. Supported error codes are:
313 <ul> 387 <ul>
314 <li>910: proxy error; the second number gives the category of the proxy 388 <li>910: proxy error; the second number gives the category of the proxy
315 error. The original response from the proxy is appended in the next 389 error. The original response from the proxy is appended in the next
329 </ul> 403 </ul>
330 </p> 404 </p>
331 <h3>Derived from</h3> 405 <h3>Derived from</h3>
332 ftplib.Error 406 ftplib.Error
333 <h3>Class Attributes</h3> 407 <h3>Class Attributes</h3>
408
334 <table> 409 <table>
335 <tr><td>None</td></tr> 410 <tr><td>None</td></tr>
336 </table> 411 </table>
337 <h3>Class Methods</h3> 412 <h3>Class Methods</h3>
413
338 <table> 414 <table>
339 <tr><td>None</td></tr> 415 <tr><td>None</td></tr>
340 </table> 416 </table>
341 <h3>Methods</h3> 417 <h3>Methods</h3>
418
342 <table> 419 <table>
343 <tr><td>None</td></tr> 420 <tr><td>None</td></tr>
344 </table> 421 </table>
345 <h3>Static Methods</h3> 422 <h3>Static Methods</h3>
423
346 <table> 424 <table>
347 <tr><td>None</td></tr> 425 <tr><td>None</td></tr>
348 </table> 426 </table>
349 427
350 <div align="right"><a href="#top">Up</a></div> 428 <div align="right"><a href="#top">Up</a></div>
351 <hr /><hr /> 429 <hr />
430 <hr />
352 <a NAME="E5FtpProxyType" ID="E5FtpProxyType"></a> 431 <a NAME="E5FtpProxyType" ID="E5FtpProxyType"></a>
353 <h2>E5FtpProxyType</h2> 432 <h2>E5FtpProxyType</h2>
433
354 <p> 434 <p>
355 Class defining the supported FTP proxy types. 435 Class defining the supported FTP proxy types.
356 </p> 436 </p>
357 <h3>Derived from</h3> 437 <h3>Derived from</h3>
358 object 438 object
359 <h3>Class Attributes</h3> 439 <h3>Class Attributes</h3>
440
360 <table> 441 <table>
361 <tr><td>AuthResp</td></tr><tr><td>Bluecoat</td></tr><tr><td>NoProxy</td></tr><tr><td>NonAuthorizing</td></tr><tr><td>Open</td></tr><tr><td>ProxyuserAtServer</td></tr><tr><td>Site</td></tr><tr><td>UserAtProxyuserAtServer</td></tr><tr><td>UserAtServer</td></tr> 442 <tr><td>AuthResp</td></tr><tr><td>Bluecoat</td></tr><tr><td>NoProxy</td></tr><tr><td>NonAuthorizing</td></tr><tr><td>Open</td></tr><tr><td>ProxyuserAtServer</td></tr><tr><td>Site</td></tr><tr><td>UserAtProxyuserAtServer</td></tr><tr><td>UserAtServer</td></tr>
362 </table> 443 </table>
363 <h3>Class Methods</h3> 444 <h3>Class Methods</h3>
445
364 <table> 446 <table>
365 <tr><td>None</td></tr> 447 <tr><td>None</td></tr>
366 </table> 448 </table>
367 <h3>Methods</h3> 449 <h3>Methods</h3>
450
368 <table> 451 <table>
369 <tr><td>None</td></tr> 452 <tr><td>None</td></tr>
370 </table> 453 </table>
371 <h3>Static Methods</h3> 454 <h3>Static Methods</h3>
455
372 <table> 456 <table>
373 <tr><td>None</td></tr> 457 <tr><td>None</td></tr>
374 </table> 458 </table>
375 459
376 <div align="right"><a href="#top">Up</a></div> 460 <div align="right"><a href="#top">Up</a></div>

eric ide

mercurial