src/eric7/Documentation/Source/eric7.DebugClients.Python.AsyncFile.html

branch
eric7
changeset 10479
856476537696
parent 10259
b51dfacef37f
child 10553
c5ef3ec68b75
equal deleted inserted replaced
10478:de9106c55c3d 10479:856476537696
5 <link rel="stylesheet" href="styles.css"> 5 <link rel="stylesheet" href="styles.css">
6 </head> 6 </head>
7 <body> 7 <body>
8 <a NAME="top" ID="top"></a> 8 <a NAME="top" ID="top"></a>
9 <h1>eric7.DebugClients.Python.AsyncFile</h1> 9 <h1>eric7.DebugClients.Python.AsyncFile</h1>
10
11 <p> 10 <p>
12 Module implementing an asynchronous file like socket interface for the 11 Module implementing an asynchronous file like socket interface for the
13 debugger. 12 debugger.
14 </p> 13 </p>
14
15 <h3>Global Attributes</h3> 15 <h3>Global Attributes</h3>
16
17 <table> 16 <table>
18 <tr><td>None</td></tr> 17 <tr><td>None</td></tr>
19 </table> 18 </table>
19
20 <h3>Classes</h3> 20 <h3>Classes</h3>
21
22 <table> 21 <table>
23
24 <tr> 22 <tr>
25 <td><a href="#AsyncFile">AsyncFile</a></td> 23 <td><a href="#AsyncFile">AsyncFile</a></td>
26 <td>Class wrapping a socket object with a file interface.</td> 24 <td>Class wrapping a socket object with a file interface.</td>
27 </tr> 25 </tr>
28 </table> 26 </table>
27
29 <h3>Functions</h3> 28 <h3>Functions</h3>
30
31 <table> 29 <table>
32
33 <tr> 30 <tr>
34 <td><a href="#AsyncPendingWrite">AsyncPendingWrite</a></td> 31 <td><a href="#AsyncPendingWrite">AsyncPendingWrite</a></td>
35 <td>Module function to check for data to be written.</td> 32 <td>Module function to check for data to be written.</td>
36 </tr> 33 </tr>
37 </table> 34 </table>
35
38 <hr /> 36 <hr />
39 <hr /> 37 <hr />
40 <a NAME="AsyncFile" ID="AsyncFile"></a> 38 <a NAME="AsyncFile" ID="AsyncFile"></a>
41 <h2>AsyncFile</h2> 39 <h2>AsyncFile</h2>
42
43 <p> 40 <p>
44 Class wrapping a socket object with a file interface. 41 Class wrapping a socket object with a file interface.
45 </p> 42 </p>
43
46 <h3>Derived from</h3> 44 <h3>Derived from</h3>
47 None 45 None
48 <h3>Class Attributes</h3> 46 <h3>Class Attributes</h3>
49
50 <table> 47 <table>
51 <tr><td>BUFSIZE</td></tr><tr><td>CMD_BUFSIZE</td></tr><tr><td>MAX_TRIES</td></tr> 48 <tr><td>BUFSIZE</td></tr>
49 <tr><td>CMD_BUFSIZE</td></tr>
50 <tr><td>MAX_TRIES</td></tr>
52 </table> 51 </table>
52
53 <h3>Class Methods</h3> 53 <h3>Class Methods</h3>
54
55 <table> 54 <table>
56 <tr><td>None</td></tr> 55 <tr><td>None</td></tr>
57 </table> 56 </table>
57
58 <h3>Methods</h3> 58 <h3>Methods</h3>
59
60 <table> 59 <table>
61
62 <tr> 60 <tr>
63 <td><a href="#AsyncFile.__init__">AsyncFile</a></td> 61 <td><a href="#AsyncFile.__init__">AsyncFile</a></td>
64 <td>Constructor</td> 62 <td>Constructor</td>
65 </tr> 63 </tr>
66 <tr> 64 <tr>
146 <tr> 144 <tr>
147 <td><a href="#AsyncFile.writelines">writelines</a></td> 145 <td><a href="#AsyncFile.writelines">writelines</a></td>
148 <td>Public method to write a list of strings to the file.</td> 146 <td>Public method to write a list of strings to the file.</td>
149 </tr> 147 </tr>
150 </table> 148 </table>
149
151 <h3>Static Methods</h3> 150 <h3>Static Methods</h3>
152
153 <table> 151 <table>
154 <tr><td>None</td></tr> 152 <tr><td>None</td></tr>
155 </table> 153 </table>
156 154
155
157 <a NAME="AsyncFile.__init__" ID="AsyncFile.__init__"></a> 156 <a NAME="AsyncFile.__init__" ID="AsyncFile.__init__"></a>
158 <h4>AsyncFile (Constructor)</h4> 157 <h4>AsyncFile (Constructor)</h4>
159 <b>AsyncFile</b>(<i>sock, mode, name</i>) 158 <b>AsyncFile</b>(<i>sock, mode, name</i>)
160
161 <p> 159 <p>
162 Constructor 160 Constructor
163 </p> 161 </p>
162
164 <dl> 163 <dl>
165 164
166 <dt><i>sock</i> (socket)</dt> 165 <dt><i>sock</i> (socket)</dt>
167 <dd> 166 <dd>
168 the socket object being wrapped 167 the socket object being wrapped
177 </dd> 176 </dd>
178 </dl> 177 </dl>
179 <a NAME="AsyncFile.__checkMode" ID="AsyncFile.__checkMode"></a> 178 <a NAME="AsyncFile.__checkMode" ID="AsyncFile.__checkMode"></a>
180 <h4>AsyncFile.__checkMode</h4> 179 <h4>AsyncFile.__checkMode</h4>
181 <b>__checkMode</b>(<i>mode</i>) 180 <b>__checkMode</b>(<i>mode</i>)
182
183 <p> 181 <p>
184 Private method to check the mode. 182 Private method to check the mode.
185 </p> 183 </p>
186 <p> 184 <p>
187 This method checks, if an operation is permitted according to 185 This method checks, if an operation is permitted according to
188 the mode of the file. If it is not, an OSError is raised. 186 the mode of the file. If it is not, an OSError is raised.
189 </p> 187 </p>
188
190 <dl> 189 <dl>
191 190
192 <dt><i>mode</i> (string)</dt> 191 <dt><i>mode</i> (string)</dt>
193 <dd> 192 <dd>
194 the mode to be checked 193 the mode to be checked
202 </dd> 201 </dd>
203 </dl> 202 </dl>
204 <a NAME="AsyncFile.close" ID="AsyncFile.close"></a> 203 <a NAME="AsyncFile.close" ID="AsyncFile.close"></a>
205 <h4>AsyncFile.close</h4> 204 <h4>AsyncFile.close</h4>
206 <b>close</b>(<i>closeit=False</i>) 205 <b>close</b>(<i>closeit=False</i>)
207
208 <p> 206 <p>
209 Public method to close the file. 207 Public method to close the file.
210 </p> 208 </p>
209
211 <dl> 210 <dl>
212 211
213 <dt><i>closeit</i> (bool)</dt> 212 <dt><i>closeit</i> (bool)</dt>
214 <dd> 213 <dd>
215 flag to indicate a close ordered by the debugger code 214 flag to indicate a close ordered by the debugger code
216 </dd> 215 </dd>
217 </dl> 216 </dl>
218 <a NAME="AsyncFile.fileno" ID="AsyncFile.fileno"></a> 217 <a NAME="AsyncFile.fileno" ID="AsyncFile.fileno"></a>
219 <h4>AsyncFile.fileno</h4> 218 <h4>AsyncFile.fileno</h4>
220 <b>fileno</b>(<i></i>) 219 <b>fileno</b>(<i></i>)
221
222 <p> 220 <p>
223 Public method returning the file number. 221 Public method returning the file number.
224 </p> 222 </p>
223
225 <dl> 224 <dl>
226 <dt>Return:</dt> 225 <dt>Return:</dt>
227 <dd> 226 <dd>
228 file number 227 file number
229 </dd> 228 </dd>
235 </dd> 234 </dd>
236 </dl> 235 </dl>
237 <a NAME="AsyncFile.flush" ID="AsyncFile.flush"></a> 236 <a NAME="AsyncFile.flush" ID="AsyncFile.flush"></a>
238 <h4>AsyncFile.flush</h4> 237 <h4>AsyncFile.flush</h4>
239 <b>flush</b>(<i></i>) 238 <b>flush</b>(<i></i>)
240
241 <p> 239 <p>
242 Public method to write all pending entries. 240 Public method to write all pending entries.
243 </p> 241 </p>
242
244 <a NAME="AsyncFile.isatty" ID="AsyncFile.isatty"></a> 243 <a NAME="AsyncFile.isatty" ID="AsyncFile.isatty"></a>
245 <h4>AsyncFile.isatty</h4> 244 <h4>AsyncFile.isatty</h4>
246 <b>isatty</b>(<i></i>) 245 <b>isatty</b>(<i></i>)
247
248 <p> 246 <p>
249 Public method to indicate whether a tty interface is supported. 247 Public method to indicate whether a tty interface is supported.
250 </p> 248 </p>
249
251 <dl> 250 <dl>
252 <dt>Return:</dt> 251 <dt>Return:</dt>
253 <dd> 252 <dd>
254 always false 253 always false
255 </dd> 254 </dd>
261 </dd> 260 </dd>
262 </dl> 261 </dl>
263 <a NAME="AsyncFile.pendingWrite" ID="AsyncFile.pendingWrite"></a> 262 <a NAME="AsyncFile.pendingWrite" ID="AsyncFile.pendingWrite"></a>
264 <h4>AsyncFile.pendingWrite</h4> 263 <h4>AsyncFile.pendingWrite</h4>
265 <b>pendingWrite</b>(<i></i>) 264 <b>pendingWrite</b>(<i></i>)
266
267 <p> 265 <p>
268 Public method that returns the number of strings waiting to be written. 266 Public method that returns the number of strings waiting to be written.
269 </p> 267 </p>
268
270 <dl> 269 <dl>
271 <dt>Return:</dt> 270 <dt>Return:</dt>
272 <dd> 271 <dd>
273 the number of strings to be written 272 the number of strings to be written
274 </dd> 273 </dd>
280 </dd> 279 </dd>
281 </dl> 280 </dl>
282 <a NAME="AsyncFile.read" ID="AsyncFile.read"></a> 281 <a NAME="AsyncFile.read" ID="AsyncFile.read"></a>
283 <h4>AsyncFile.read</h4> 282 <h4>AsyncFile.read</h4>
284 <b>read</b>(<i>size=-1</i>) 283 <b>read</b>(<i>size=-1</i>)
285
286 <p> 284 <p>
287 Public method to read bytes from this file. 285 Public method to read bytes from this file.
288 </p> 286 </p>
287
289 <dl> 288 <dl>
290 289
291 <dt><i>size</i> (int)</dt> 290 <dt><i>size</i> (int)</dt>
292 <dd> 291 <dd>
293 maximum number of bytes to be read 292 maximum number of bytes to be read
306 </dd> 305 </dd>
307 </dl> 306 </dl>
308 <a NAME="AsyncFile.readCommand" ID="AsyncFile.readCommand"></a> 307 <a NAME="AsyncFile.readCommand" ID="AsyncFile.readCommand"></a>
309 <h4>AsyncFile.readCommand</h4> 308 <h4>AsyncFile.readCommand</h4>
310 <b>readCommand</b>(<i></i>) 309 <b>readCommand</b>(<i></i>)
311
312 <p> 310 <p>
313 Public method to read a length prefixed command string. 311 Public method to read a length prefixed command string.
314 </p> 312 </p>
313
315 <dl> 314 <dl>
316 <dt>Return:</dt> 315 <dt>Return:</dt>
317 <dd> 316 <dd>
318 command string 317 command string
319 </dd> 318 </dd>
325 </dd> 324 </dd>
326 </dl> 325 </dl>
327 <a NAME="AsyncFile.read_p" ID="AsyncFile.read_p"></a> 326 <a NAME="AsyncFile.read_p" ID="AsyncFile.read_p"></a>
328 <h4>AsyncFile.read_p</h4> 327 <h4>AsyncFile.read_p</h4>
329 <b>read_p</b>(<i>size=-1</i>) 328 <b>read_p</b>(<i>size=-1</i>)
330
331 <p> 329 <p>
332 Public method to read bytes from this file. 330 Public method to read bytes from this file.
333 </p> 331 </p>
332
334 <dl> 333 <dl>
335 334
336 <dt><i>size</i> (int)</dt> 335 <dt><i>size</i> (int)</dt>
337 <dd> 336 <dd>
338 maximum number of bytes to be read 337 maximum number of bytes to be read
351 </dd> 350 </dd>
352 </dl> 351 </dl>
353 <a NAME="AsyncFile.readable" ID="AsyncFile.readable"></a> 352 <a NAME="AsyncFile.readable" ID="AsyncFile.readable"></a>
354 <h4>AsyncFile.readable</h4> 353 <h4>AsyncFile.readable</h4>
355 <b>readable</b>(<i></i>) 354 <b>readable</b>(<i></i>)
356
357 <p> 355 <p>
358 Public method to check, if the stream is readable. 356 Public method to check, if the stream is readable.
359 </p> 357 </p>
358
360 <dl> 359 <dl>
361 <dt>Return:</dt> 360 <dt>Return:</dt>
362 <dd> 361 <dd>
363 flag indicating a readable stream 362 flag indicating a readable stream
364 </dd> 363 </dd>
370 </dd> 369 </dd>
371 </dl> 370 </dl>
372 <a NAME="AsyncFile.readline" ID="AsyncFile.readline"></a> 371 <a NAME="AsyncFile.readline" ID="AsyncFile.readline"></a>
373 <h4>AsyncFile.readline</h4> 372 <h4>AsyncFile.readline</h4>
374 <b>readline</b>(<i>sizehint=-1</i>) 373 <b>readline</b>(<i>sizehint=-1</i>)
375
376 <p> 374 <p>
377 Public method to read one line from this file. 375 Public method to read one line from this file.
378 </p> 376 </p>
377
379 <dl> 378 <dl>
380 379
381 <dt><i>sizehint</i> (int)</dt> 380 <dt><i>sizehint</i> (int)</dt>
382 <dd> 381 <dd>
383 hint of the numbers of bytes to be read 382 hint of the numbers of bytes to be read
396 </dd> 395 </dd>
397 </dl> 396 </dl>
398 <a NAME="AsyncFile.readline_p" ID="AsyncFile.readline_p"></a> 397 <a NAME="AsyncFile.readline_p" ID="AsyncFile.readline_p"></a>
399 <h4>AsyncFile.readline_p</h4> 398 <h4>AsyncFile.readline_p</h4>
400 <b>readline_p</b>(<i>size=-1</i>) 399 <b>readline_p</b>(<i>size=-1</i>)
401
402 <p> 400 <p>
403 Public method to read a line from this file. 401 Public method to read a line from this file.
404 </p> 402 </p>
405 <p> 403 <p>
406 <b>Note</b>: This method will not block and may return 404 <b>Note</b>: This method will not block and may return
407 only a part of a line if that is all that is available. 405 only a part of a line if that is all that is available.
408 </p> 406 </p>
407
409 <dl> 408 <dl>
410 409
411 <dt><i>size</i> (int)</dt> 410 <dt><i>size</i> (int)</dt>
412 <dd> 411 <dd>
413 maximum number of bytes to be read 412 maximum number of bytes to be read
426 </dd> 425 </dd>
427 </dl> 426 </dl>
428 <a NAME="AsyncFile.readlines" ID="AsyncFile.readlines"></a> 427 <a NAME="AsyncFile.readlines" ID="AsyncFile.readlines"></a>
429 <h4>AsyncFile.readlines</h4> 428 <h4>AsyncFile.readlines</h4>
430 <b>readlines</b>(<i>sizehint=-1</i>) 429 <b>readlines</b>(<i>sizehint=-1</i>)
431
432 <p> 430 <p>
433 Public method to read all lines from this file. 431 Public method to read all lines from this file.
434 </p> 432 </p>
433
435 <dl> 434 <dl>
436 435
437 <dt><i>sizehint</i> (int)</dt> 436 <dt><i>sizehint</i> (int)</dt>
438 <dd> 437 <dd>
439 hint of the numbers of bytes to be read 438 hint of the numbers of bytes to be read
452 </dd> 451 </dd>
453 </dl> 452 </dl>
454 <a NAME="AsyncFile.seek" ID="AsyncFile.seek"></a> 453 <a NAME="AsyncFile.seek" ID="AsyncFile.seek"></a>
455 <h4>AsyncFile.seek</h4> 454 <h4>AsyncFile.seek</h4>
456 <b>seek</b>(<i>offset, whence=0</i>) 455 <b>seek</b>(<i>offset, whence=0</i>)
457
458 <p> 456 <p>
459 Public method to move the filepointer. 457 Public method to move the filepointer.
460 </p> 458 </p>
459
461 <dl> 460 <dl>
462 461
463 <dt><i>offset</i> (int)</dt> 462 <dt><i>offset</i> (int)</dt>
464 <dd> 463 <dd>
465 offset to move the filepointer to 464 offset to move the filepointer to
478 </dd> 477 </dd>
479 </dl> 478 </dl>
480 <a NAME="AsyncFile.seekable" ID="AsyncFile.seekable"></a> 479 <a NAME="AsyncFile.seekable" ID="AsyncFile.seekable"></a>
481 <h4>AsyncFile.seekable</h4> 480 <h4>AsyncFile.seekable</h4>
482 <b>seekable</b>(<i></i>) 481 <b>seekable</b>(<i></i>)
483
484 <p> 482 <p>
485 Public method to check, if the stream is seekable. 483 Public method to check, if the stream is seekable.
486 </p> 484 </p>
485
487 <dl> 486 <dl>
488 <dt>Return:</dt> 487 <dt>Return:</dt>
489 <dd> 488 <dd>
490 flag indicating a seekable stream 489 flag indicating a seekable stream
491 </dd> 490 </dd>
497 </dd> 496 </dd>
498 </dl> 497 </dl>
499 <a NAME="AsyncFile.tell" ID="AsyncFile.tell"></a> 498 <a NAME="AsyncFile.tell" ID="AsyncFile.tell"></a>
500 <h4>AsyncFile.tell</h4> 499 <h4>AsyncFile.tell</h4>
501 <b>tell</b>(<i></i>) 500 <b>tell</b>(<i></i>)
502
503 <p> 501 <p>
504 Public method to get the filepointer position. 502 Public method to get the filepointer position.
505 </p> 503 </p>
504
506 <dl> 505 <dl>
507 506
508 <dt>Raises <b>OSError</b>:</dt> 507 <dt>Raises <b>OSError</b>:</dt>
509 <dd> 508 <dd>
510 This method is not supported and always raises an 509 This method is not supported and always raises an
512 </dd> 511 </dd>
513 </dl> 512 </dl>
514 <a NAME="AsyncFile.truncate" ID="AsyncFile.truncate"></a> 513 <a NAME="AsyncFile.truncate" ID="AsyncFile.truncate"></a>
515 <h4>AsyncFile.truncate</h4> 514 <h4>AsyncFile.truncate</h4>
516 <b>truncate</b>(<i>size=-1</i>) 515 <b>truncate</b>(<i>size=-1</i>)
517
518 <p> 516 <p>
519 Public method to truncate the file. 517 Public method to truncate the file.
520 </p> 518 </p>
519
521 <dl> 520 <dl>
522 521
523 <dt><i>size</i> (int)</dt> 522 <dt><i>size</i> (int)</dt>
524 <dd> 523 <dd>
525 size to truncate to 524 size to truncate to
534 </dd> 533 </dd>
535 </dl> 534 </dl>
536 <a NAME="AsyncFile.writable" ID="AsyncFile.writable"></a> 535 <a NAME="AsyncFile.writable" ID="AsyncFile.writable"></a>
537 <h4>AsyncFile.writable</h4> 536 <h4>AsyncFile.writable</h4>
538 <b>writable</b>(<i></i>) 537 <b>writable</b>(<i></i>)
539
540 <p> 538 <p>
541 Public method to check, if a stream is writable. 539 Public method to check, if a stream is writable.
542 </p> 540 </p>
541
543 <dl> 542 <dl>
544 <dt>Return:</dt> 543 <dt>Return:</dt>
545 <dd> 544 <dd>
546 flag indicating a writable stream 545 flag indicating a writable stream
547 </dd> 546 </dd>
553 </dd> 552 </dd>
554 </dl> 553 </dl>
555 <a NAME="AsyncFile.write" ID="AsyncFile.write"></a> 554 <a NAME="AsyncFile.write" ID="AsyncFile.write"></a>
556 <h4>AsyncFile.write</h4> 555 <h4>AsyncFile.write</h4>
557 <b>write</b>(<i>s</i>) 556 <b>write</b>(<i>s</i>)
558
559 <p> 557 <p>
560 Public method to write a string to the file. 558 Public method to write a string to the file.
561 </p> 559 </p>
560
562 <dl> 561 <dl>
563 562
564 <dt><i>s</i> (str, bytes or bytearray)</dt> 563 <dt><i>s</i> (str, bytes or bytearray)</dt>
565 <dd> 564 <dd>
566 text to be written 565 text to be written
567 </dd> 566 </dd>
568 </dl> 567 </dl>
569 <a NAME="AsyncFile.write_p" ID="AsyncFile.write_p"></a> 568 <a NAME="AsyncFile.write_p" ID="AsyncFile.write_p"></a>
570 <h4>AsyncFile.write_p</h4> 569 <h4>AsyncFile.write_p</h4>
571 <b>write_p</b>(<i>s</i>) 570 <b>write_p</b>(<i>s</i>)
572
573 <p> 571 <p>
574 Public method to write a json-rpc 2.0 coded string to the file. 572 Public method to write a json-rpc 2.0 coded string to the file.
575 </p> 573 </p>
574
576 <dl> 575 <dl>
577 576
578 <dt><i>s</i> (str)</dt> 577 <dt><i>s</i> (str)</dt>
579 <dd> 578 <dd>
580 text to be written 579 text to be written
581 </dd> 580 </dd>
582 </dl> 581 </dl>
583 <a NAME="AsyncFile.writelines" ID="AsyncFile.writelines"></a> 582 <a NAME="AsyncFile.writelines" ID="AsyncFile.writelines"></a>
584 <h4>AsyncFile.writelines</h4> 583 <h4>AsyncFile.writelines</h4>
585 <b>writelines</b>(<i>lines</i>) 584 <b>writelines</b>(<i>lines</i>)
586
587 <p> 585 <p>
588 Public method to write a list of strings to the file. 586 Public method to write a list of strings to the file.
589 </p> 587 </p>
588
590 <dl> 589 <dl>
591 590
592 <dt><i>lines</i> (list of str)</dt> 591 <dt><i>lines</i> (list of str)</dt>
593 <dd> 592 <dd>
594 list of texts to be written 593 list of texts to be written
598 <hr /> 597 <hr />
599 <hr /> 598 <hr />
600 <a NAME="AsyncPendingWrite" ID="AsyncPendingWrite"></a> 599 <a NAME="AsyncPendingWrite" ID="AsyncPendingWrite"></a>
601 <h2>AsyncPendingWrite</h2> 600 <h2>AsyncPendingWrite</h2>
602 <b>AsyncPendingWrite</b>(<i>file</i>) 601 <b>AsyncPendingWrite</b>(<i>file</i>)
603
604 <p> 602 <p>
605 Module function to check for data to be written. 603 Module function to check for data to be written.
606 </p> 604 </p>
605
607 <dl> 606 <dl>
608 607
609 <dt><i>file</i> (file)</dt> 608 <dt><i>file</i> (file)</dt>
610 <dd> 609 <dd>
611 The file object to be checked 610 The file object to be checked

eric ide

mercurial