eric6/Documentation/Source/eric6.Utilities.FtpUtilities.html

branch
maintenance
changeset 7286
7eb04391adf7
parent 7273
391d6b7b1eff
child 7989
a21d673a8f99
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.Utilities.FtpUtilities</h1> 23 <h1>eric6.Utilities.FtpUtilities</h1>
24
23 <p> 25 <p>
24 Module implementing some FTP related utilities. 26 Module implementing some FTP related utilities.
25 </p> 27 </p>
26 <h3>Global Attributes</h3> 28 <h3>Global Attributes</h3>
29
27 <table> 30 <table>
28 <tr><td>None</td></tr> 31 <tr><td>None</td></tr>
29 </table> 32 </table>
30 <h3>Classes</h3> 33 <h3>Classes</h3>
31 <table> 34
35 <table>
36
32 <tr> 37 <tr>
33 <td><a href="#FtpDirLineParser">FtpDirLineParser</a></td> 38 <td><a href="#FtpDirLineParser">FtpDirLineParser</a></td>
34 <td>Class to parse lines returned by a FTP LIST command.</td> 39 <td>Class to parse lines returned by a FTP LIST command.</td>
35 </tr><tr> 40 </tr>
41 <tr>
36 <td><a href="#FtpDirLineParserError">FtpDirLineParserError</a></td> 42 <td><a href="#FtpDirLineParserError">FtpDirLineParserError</a></td>
37 <td>Exception class raised, if a parser issue was detected.</td> 43 <td>Exception class raised, if a parser issue was detected.</td>
38 </tr> 44 </tr>
39 </table> 45 </table>
40 <h3>Functions</h3> 46 <h3>Functions</h3>
41 <table> 47
42 <tr><td>None</td></tr> 48 <table>
43 </table> 49 <tr><td>None</td></tr>
44 <hr /><hr /> 50 </table>
51 <hr />
52 <hr />
45 <a NAME="FtpDirLineParser" ID="FtpDirLineParser"></a> 53 <a NAME="FtpDirLineParser" ID="FtpDirLineParser"></a>
46 <h2>FtpDirLineParser</h2> 54 <h2>FtpDirLineParser</h2>
55
47 <p> 56 <p>
48 Class to parse lines returned by a FTP LIST command. 57 Class to parse lines returned by a FTP LIST command.
49 </p> 58 </p>
50 <h3>Derived from</h3> 59 <h3>Derived from</h3>
51 QObject 60 QObject
52 <h3>Class Attributes</h3> 61 <h3>Class Attributes</h3>
62
53 <table> 63 <table>
54 <tr><td>MonthnamesNumbers</td></tr> 64 <tr><td>MonthnamesNumbers</td></tr>
55 </table> 65 </table>
56 <h3>Class Methods</h3> 66 <h3>Class Methods</h3>
67
57 <table> 68 <table>
58 <tr><td>None</td></tr> 69 <tr><td>None</td></tr>
59 </table> 70 </table>
60 <h3>Methods</h3> 71 <h3>Methods</h3>
61 <table> 72
73 <table>
74
62 <tr> 75 <tr>
63 <td><a href="#FtpDirLineParser.__init__">FtpDirLineParser</a></td> 76 <td><a href="#FtpDirLineParser.__init__">FtpDirLineParser</a></td>
64 <td>Constructor</td> 77 <td>Constructor</td>
65 </tr><tr> 78 </tr>
79 <tr>
66 <td><a href="#FtpDirLineParser.__ignoreLine">__ignoreLine</a></td> 80 <td><a href="#FtpDirLineParser.__ignoreLine">__ignoreLine</a></td>
67 <td>Private method to check, if the line should be ignored.</td> 81 <td>Private method to check, if the line should be ignored.</td>
68 </tr><tr> 82 </tr>
83 <tr>
69 <td><a href="#FtpDirLineParser.__parseUnixLine">__parseUnixLine</a></td> 84 <td><a href="#FtpDirLineParser.__parseUnixLine">__parseUnixLine</a></td>
70 <td>Private method to parse a Unix style directory listing line.</td> 85 <td>Private method to parse a Unix style directory listing line.</td>
71 </tr><tr> 86 </tr>
87 <tr>
72 <td><a href="#FtpDirLineParser.__parseUnixMode">__parseUnixMode</a></td> 88 <td><a href="#FtpDirLineParser.__parseUnixMode">__parseUnixMode</a></td>
73 <td>Private method to parse a Unix mode string modifying the given URL info object.</td> 89 <td>Private method to parse a Unix mode string modifying the given URL info object.</td>
74 </tr><tr> 90 </tr>
91 <tr>
75 <td><a href="#FtpDirLineParser.__parseUnixTime">__parseUnixTime</a></td> 92 <td><a href="#FtpDirLineParser.__parseUnixTime">__parseUnixTime</a></td>
76 <td>Private method to parse a Unix date and time indication modifying the given URL info object.</td> 93 <td>Private method to parse a Unix date and time indication modifying the given URL info object.</td>
77 </tr><tr> 94 </tr>
95 <tr>
78 <td><a href="#FtpDirLineParser.__parseWindowsLine">__parseWindowsLine</a></td> 96 <td><a href="#FtpDirLineParser.__parseWindowsLine">__parseWindowsLine</a></td>
79 <td>Private method to parse a Windows style directory listing line.</td> 97 <td>Private method to parse a Windows style directory listing line.</td>
80 </tr><tr> 98 </tr>
99 <tr>
81 <td><a href="#FtpDirLineParser.__parseWindowsTime">__parseWindowsTime</a></td> 100 <td><a href="#FtpDirLineParser.__parseWindowsTime">__parseWindowsTime</a></td>
82 <td>Private method to parse a Windows date and time indication modifying the given URL info object.</td> 101 <td>Private method to parse a Windows date and time indication modifying the given URL info object.</td>
83 </tr><tr> 102 </tr>
103 <tr>
84 <td><a href="#FtpDirLineParser.__splitUnixLine">__splitUnixLine</a></td> 104 <td><a href="#FtpDirLineParser.__splitUnixLine">__splitUnixLine</a></td>
85 <td>Private method to split a line of a Unix like directory listing.</td> 105 <td>Private method to split a line of a Unix like directory listing.</td>
86 </tr><tr> 106 </tr>
107 <tr>
87 <td><a href="#FtpDirLineParser.parseLine">parseLine</a></td> 108 <td><a href="#FtpDirLineParser.parseLine">parseLine</a></td>
88 <td>Public method to parse a directory listing line.</td> 109 <td>Public method to parse a directory listing line.</td>
89 </tr> 110 </tr>
90 </table> 111 </table>
91 <h3>Static Methods</h3> 112 <h3>Static Methods</h3>
92 <table> 113
93 <tr><td>None</td></tr> 114 <table>
94 </table> 115 <tr><td>None</td></tr>
116 </table>
117
95 <a NAME="FtpDirLineParser.__init__" ID="FtpDirLineParser.__init__"></a> 118 <a NAME="FtpDirLineParser.__init__" ID="FtpDirLineParser.__init__"></a>
96 <h4>FtpDirLineParser (Constructor)</h4> 119 <h4>FtpDirLineParser (Constructor)</h4>
97 <b>FtpDirLineParser</b>(<i>parent=None</i>) 120 <b>FtpDirLineParser</b>(<i>parent=None</i>)
121
98 <p> 122 <p>
99 Constructor 123 Constructor
100 </p><dl> 124 </p>
125 <dl>
126
101 <dt><i>parent</i></dt> 127 <dt><i>parent</i></dt>
102 <dd> 128 <dd>
103 reference to the parent object (QObject) 129 reference to the parent object (QObject)
104 </dd> 130 </dd>
105 </dl><a NAME="FtpDirLineParser.__ignoreLine" ID="FtpDirLineParser.__ignoreLine"></a> 131 </dl>
132 <a NAME="FtpDirLineParser.__ignoreLine" ID="FtpDirLineParser.__ignoreLine"></a>
106 <h4>FtpDirLineParser.__ignoreLine</h4> 133 <h4>FtpDirLineParser.__ignoreLine</h4>
107 <b>__ignoreLine</b>(<i>line</i>) 134 <b>__ignoreLine</b>(<i>line</i>)
135
108 <p> 136 <p>
109 Private method to check, if the line should be ignored. 137 Private method to check, if the line should be ignored.
110 </p><dl> 138 </p>
139 <dl>
140
111 <dt><i>line</i></dt> 141 <dt><i>line</i></dt>
112 <dd> 142 <dd>
113 to check (string) 143 to check (string)
114 </dd> 144 </dd>
115 </dl><dl> 145 </dl>
146 <dl>
116 <dt>Returns:</dt> 147 <dt>Returns:</dt>
117 <dd> 148 <dd>
118 flag indicating to ignore the line (boolean) 149 flag indicating to ignore the line (boolean)
119 </dd> 150 </dd>
120 </dl><a NAME="FtpDirLineParser.__parseUnixLine" ID="FtpDirLineParser.__parseUnixLine"></a> 151 </dl>
152 <a NAME="FtpDirLineParser.__parseUnixLine" ID="FtpDirLineParser.__parseUnixLine"></a>
121 <h4>FtpDirLineParser.__parseUnixLine</h4> 153 <h4>FtpDirLineParser.__parseUnixLine</h4>
122 <b>__parseUnixLine</b>(<i>line</i>) 154 <b>__parseUnixLine</b>(<i>line</i>)
155
123 <p> 156 <p>
124 Private method to parse a Unix style directory listing line. 157 Private method to parse a Unix style directory listing line.
125 </p><dl> 158 </p>
159 <dl>
160
126 <dt><i>line</i></dt> 161 <dt><i>line</i></dt>
127 <dd> 162 <dd>
128 directory line to be parsed (string) 163 directory line to be parsed (string)
129 </dd> 164 </dd>
130 </dl><dl> 165 </dl>
166 <dl>
131 <dt>Returns:</dt> 167 <dt>Returns:</dt>
132 <dd> 168 <dd>
133 URL info object containing the valid data (E5UrlInfo) 169 URL info object containing the valid data (E5UrlInfo)
134 </dd> 170 </dd>
135 </dl><a NAME="FtpDirLineParser.__parseUnixMode" ID="FtpDirLineParser.__parseUnixMode"></a> 171 </dl>
172 <a NAME="FtpDirLineParser.__parseUnixMode" ID="FtpDirLineParser.__parseUnixMode"></a>
136 <h4>FtpDirLineParser.__parseUnixMode</h4> 173 <h4>FtpDirLineParser.__parseUnixMode</h4>
137 <b>__parseUnixMode</b>(<i>modeString, urlInfo</i>) 174 <b>__parseUnixMode</b>(<i>modeString, urlInfo</i>)
175
138 <p> 176 <p>
139 Private method to parse a Unix mode string modifying the 177 Private method to parse a Unix mode string modifying the
140 given URL info object. 178 given URL info object.
141 </p><dl> 179 </p>
180 <dl>
181
142 <dt><i>modeString</i></dt> 182 <dt><i>modeString</i></dt>
143 <dd> 183 <dd>
144 mode string to be parsed (string) 184 mode string to be parsed (string)
145 </dd><dt><i>urlInfo</i></dt> 185 </dd>
186 <dt><i>urlInfo</i></dt>
146 <dd> 187 <dd>
147 reference to the URL info object (E5UrlInfo) 188 reference to the URL info object (E5UrlInfo)
148 </dd> 189 </dd>
149 </dl><dl> 190 </dl>
191 <dl>
192
150 <dt>Raises <b>FtpDirLineParserError</b>:</dt> 193 <dt>Raises <b>FtpDirLineParserError</b>:</dt>
151 <dd> 194 <dd>
152 Raised if the mode cannot be parsed. 195 Raised if the mode cannot be parsed.
153 </dd> 196 </dd>
154 </dl><a NAME="FtpDirLineParser.__parseUnixTime" ID="FtpDirLineParser.__parseUnixTime"></a> 197 </dl>
198 <a NAME="FtpDirLineParser.__parseUnixTime" ID="FtpDirLineParser.__parseUnixTime"></a>
155 <h4>FtpDirLineParser.__parseUnixTime</h4> 199 <h4>FtpDirLineParser.__parseUnixTime</h4>
156 <b>__parseUnixTime</b>(<i>monthAbbreviation, day, yearOrTime, urlInfo</i>) 200 <b>__parseUnixTime</b>(<i>monthAbbreviation, day, yearOrTime, urlInfo</i>)
201
157 <p> 202 <p>
158 Private method to parse a Unix date and time indication modifying 203 Private method to parse a Unix date and time indication modifying
159 the given URL info object. 204 the given URL info object.
160 </p><p> 205 </p>
161 206 <p>
162 </p><p> 207
208 </p>
209 <p>
163 Date time strings in Unix-style directory listings typically 210 Date time strings in Unix-style directory listings typically
164 have one of these formats: 211 have one of these formats:
165 <ul> 212 <ul>
166 <li>"Nov 23 02:33" (month name, day of month, time)</li> 213 <li>"Nov 23 02:33" (month name, day of month, time)</li>
167 <li>"May 26 2005" (month name, day of month, year)</li> 214 <li>"May 26 2005" (month name, day of month, year)</li>
168 </ul> 215 </ul>
169 </p><dl> 216 </p>
217 <dl>
218
170 <dt><i>monthAbbreviation</i></dt> 219 <dt><i>monthAbbreviation</i></dt>
171 <dd> 220 <dd>
172 abbreviation of the month name (string) 221 abbreviation of the month name (string)
173 </dd><dt><i>day</i></dt> 222 </dd>
223 <dt><i>day</i></dt>
174 <dd> 224 <dd>
175 day of the month (string) 225 day of the month (string)
176 </dd><dt><i>yearOrTime</i></dt> 226 </dd>
227 <dt><i>yearOrTime</i></dt>
177 <dd> 228 <dd>
178 string giving the year or a time (string) 229 string giving the year or a time (string)
179 </dd><dt><i>urlInfo</i></dt> 230 </dd>
231 <dt><i>urlInfo</i></dt>
180 <dd> 232 <dd>
181 reference to the URL info object (E5UrlInfo) 233 reference to the URL info object (E5UrlInfo)
182 </dd> 234 </dd>
183 </dl><dl> 235 </dl>
236 <dl>
237
184 <dt>Raises <b>FtpDirLineParserError</b>:</dt> 238 <dt>Raises <b>FtpDirLineParserError</b>:</dt>
185 <dd> 239 <dd>
186 Raised if the month abbreviation is 240 Raised if the month abbreviation is
187 not recognized. 241 not recognized.
188 </dd> 242 </dd>
189 </dl><a NAME="FtpDirLineParser.__parseWindowsLine" ID="FtpDirLineParser.__parseWindowsLine"></a> 243 </dl>
244 <a NAME="FtpDirLineParser.__parseWindowsLine" ID="FtpDirLineParser.__parseWindowsLine"></a>
190 <h4>FtpDirLineParser.__parseWindowsLine</h4> 245 <h4>FtpDirLineParser.__parseWindowsLine</h4>
191 <b>__parseWindowsLine</b>(<i>line</i>) 246 <b>__parseWindowsLine</b>(<i>line</i>)
247
192 <p> 248 <p>
193 Private method to parse a Windows style directory listing line. 249 Private method to parse a Windows style directory listing line.
194 </p><dl> 250 </p>
251 <dl>
252
195 <dt><i>line</i></dt> 253 <dt><i>line</i></dt>
196 <dd> 254 <dd>
197 directory line to be parsed (string) 255 directory line to be parsed (string)
198 </dd> 256 </dd>
199 </dl><dl> 257 </dl>
258 <dl>
200 <dt>Returns:</dt> 259 <dt>Returns:</dt>
201 <dd> 260 <dd>
202 URL info object containing the valid data (E5UrlInfo) 261 URL info object containing the valid data (E5UrlInfo)
203 </dd> 262 </dd>
204 </dl><dl> 263 </dl>
264 <dl>
265
205 <dt>Raises <b>FtpDirLineParserError</b>:</dt> 266 <dt>Raises <b>FtpDirLineParserError</b>:</dt>
206 <dd> 267 <dd>
207 Raised if the line is not of a 268 Raised if the line is not of a
208 recognized Windows format. 269 recognized Windows format.
209 </dd> 270 </dd>
210 </dl><a NAME="FtpDirLineParser.__parseWindowsTime" ID="FtpDirLineParser.__parseWindowsTime"></a> 271 </dl>
272 <a NAME="FtpDirLineParser.__parseWindowsTime" ID="FtpDirLineParser.__parseWindowsTime"></a>
211 <h4>FtpDirLineParser.__parseWindowsTime</h4> 273 <h4>FtpDirLineParser.__parseWindowsTime</h4>
212 <b>__parseWindowsTime</b>(<i>date, time, urlInfo</i>) 274 <b>__parseWindowsTime</b>(<i>date, time, urlInfo</i>)
275
213 <p> 276 <p>
214 Private method to parse a Windows date and time indication modifying 277 Private method to parse a Windows date and time indication modifying
215 the given URL info object. 278 the given URL info object.
216 </p><p> 279 </p>
280 <p>
217 Date time strings in Windows-style directory listings typically 281 Date time strings in Windows-style directory listings typically
218 have the format "10-23-12 03:25PM" (month-day_of_month-two_digit_year, 282 have the format "10-23-12 03:25PM" (month-day_of_month-two_digit_year,
219 hour:minute, am/pm). 283 hour:minute, am/pm).
220 </p><dl> 284 </p>
285 <dl>
286
221 <dt><i>date</i></dt> 287 <dt><i>date</i></dt>
222 <dd> 288 <dd>
223 date string (string) 289 date string (string)
224 </dd><dt><i>time</i></dt> 290 </dd>
291 <dt><i>time</i></dt>
225 <dd> 292 <dd>
226 time string (string) 293 time string (string)
227 </dd><dt><i>urlInfo</i></dt> 294 </dd>
295 <dt><i>urlInfo</i></dt>
228 <dd> 296 <dd>
229 reference to the URL info object (E5UrlInfo) 297 reference to the URL info object (E5UrlInfo)
230 </dd> 298 </dd>
231 </dl><dl> 299 </dl>
300 <dl>
301
232 <dt>Raises <b>FtpDirLineParserError</b>:</dt> 302 <dt>Raises <b>FtpDirLineParserError</b>:</dt>
233 <dd> 303 <dd>
234 Raised if either of the strings is not 304 Raised if either of the strings is not
235 recognized. 305 recognized.
236 </dd> 306 </dd>
237 </dl><a NAME="FtpDirLineParser.__splitUnixLine" ID="FtpDirLineParser.__splitUnixLine"></a> 307 </dl>
308 <a NAME="FtpDirLineParser.__splitUnixLine" ID="FtpDirLineParser.__splitUnixLine"></a>
238 <h4>FtpDirLineParser.__splitUnixLine</h4> 309 <h4>FtpDirLineParser.__splitUnixLine</h4>
239 <b>__splitUnixLine</b>(<i>line</i>) 310 <b>__splitUnixLine</b>(<i>line</i>)
311
240 <p> 312 <p>
241 Private method to split a line of a Unix like directory listing. 313 Private method to split a line of a Unix like directory listing.
242 </p><p> 314 </p>
315 <p>
243 It splits the line into meta data, number of links, user, group, size, 316 It splits the line into meta data, number of links, user, group, size,
244 month, day, year or time and name. 317 month, day, year or time and name.
245 </p><dl> 318 </p>
319 <dl>
320
246 <dt><i>line</i></dt> 321 <dt><i>line</i></dt>
247 <dd> 322 <dd>
248 directory line to split (string) 323 directory line to split (string)
249 </dd> 324 </dd>
250 </dl><dl> 325 </dl>
326 <dl>
251 <dt>Returns:</dt> 327 <dt>Returns:</dt>
252 <dd> 328 <dd>
253 tuple of nine strings giving the meta data, 329 tuple of nine strings giving the meta data,
254 number of links, user, group, size, month, day, year or time 330 number of links, user, group, size, month, day, year or time
255 and name 331 and name
256 </dd> 332 </dd>
257 </dl><dl> 333 </dl>
334 <dl>
335
258 <dt>Raises <b>FtpDirLineParserError</b>:</dt> 336 <dt>Raises <b>FtpDirLineParserError</b>:</dt>
259 <dd> 337 <dd>
260 Raised if the line is not of a 338 Raised if the line is not of a
261 recognized Unix format. 339 recognized Unix format.
262 </dd> 340 </dd>
263 </dl><a NAME="FtpDirLineParser.parseLine" ID="FtpDirLineParser.parseLine"></a> 341 </dl>
342 <a NAME="FtpDirLineParser.parseLine" ID="FtpDirLineParser.parseLine"></a>
264 <h4>FtpDirLineParser.parseLine</h4> 343 <h4>FtpDirLineParser.parseLine</h4>
265 <b>parseLine</b>(<i>line</i>) 344 <b>parseLine</b>(<i>line</i>)
345
266 <p> 346 <p>
267 Public method to parse a directory listing line. 347 Public method to parse a directory listing line.
268 </p><p> 348 </p>
349 <p>
269 This implementation support Unix and Windows style directory 350 This implementation support Unix and Windows style directory
270 listings. It tries Unix style first and if that fails switches 351 listings. It tries Unix style first and if that fails switches
271 to Windows style. If that fails as well, an exception is raised. 352 to Windows style. If that fails as well, an exception is raised.
272 </p><dl> 353 </p>
354 <dl>
355
273 <dt><i>line</i></dt> 356 <dt><i>line</i></dt>
274 <dd> 357 <dd>
275 directory line to be parsed (string) 358 directory line to be parsed (string)
276 </dd> 359 </dd>
277 </dl><dl> 360 </dl>
361 <dl>
278 <dt>Returns:</dt> 362 <dt>Returns:</dt>
279 <dd> 363 <dd>
280 URL info object containing the valid data (E5UrlInfo) 364 URL info object containing the valid data (E5UrlInfo)
281 </dd> 365 </dd>
282 </dl> 366 </dl>
283 <div align="right"><a href="#top">Up</a></div> 367 <div align="right"><a href="#top">Up</a></div>
284 <hr /><hr /> 368 <hr />
369 <hr />
285 <a NAME="FtpDirLineParserError" ID="FtpDirLineParserError"></a> 370 <a NAME="FtpDirLineParserError" ID="FtpDirLineParserError"></a>
286 <h2>FtpDirLineParserError</h2> 371 <h2>FtpDirLineParserError</h2>
372
287 <p> 373 <p>
288 Exception class raised, if a parser issue was detected. 374 Exception class raised, if a parser issue was detected.
289 </p> 375 </p>
290 <h3>Derived from</h3> 376 <h3>Derived from</h3>
291 Exception 377 Exception
292 <h3>Class Attributes</h3> 378 <h3>Class Attributes</h3>
379
293 <table> 380 <table>
294 <tr><td>None</td></tr> 381 <tr><td>None</td></tr>
295 </table> 382 </table>
296 <h3>Class Methods</h3> 383 <h3>Class Methods</h3>
384
297 <table> 385 <table>
298 <tr><td>None</td></tr> 386 <tr><td>None</td></tr>
299 </table> 387 </table>
300 <h3>Methods</h3> 388 <h3>Methods</h3>
389
301 <table> 390 <table>
302 <tr><td>None</td></tr> 391 <tr><td>None</td></tr>
303 </table> 392 </table>
304 <h3>Static Methods</h3> 393 <h3>Static Methods</h3>
394
305 <table> 395 <table>
306 <tr><td>None</td></tr> 396 <tr><td>None</td></tr>
307 </table> 397 </table>
308 398
309 <div align="right"><a href="#top">Up</a></div> 399 <div align="right"><a href="#top">Up</a></div>

eric ide

mercurial