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.DebugClients.Python.AsyncFile</h1> |
23 <h1>eric6.DebugClients.Python.AsyncFile</h1> |
|
24 |
23 <p> |
25 <p> |
24 Module implementing an asynchronous file like socket interface for the |
26 Module implementing an asynchronous file like socket interface for the |
25 debugger. |
27 debugger. |
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> |
|
35 |
32 <table> |
36 <table> |
|
37 |
33 <tr> |
38 <tr> |
34 <td><a href="#AsyncFile">AsyncFile</a></td> |
39 <td><a href="#AsyncFile">AsyncFile</a></td> |
35 <td>Class wrapping a socket object with a file interface.</td> |
40 <td>Class wrapping a socket object with a file interface.</td> |
36 </tr> |
41 </tr> |
37 </table> |
42 </table> |
38 <h3>Functions</h3> |
43 <h3>Functions</h3> |
|
44 |
39 <table> |
45 <table> |
|
46 |
40 <tr> |
47 <tr> |
41 <td><a href="#AsyncPendingWrite">AsyncPendingWrite</a></td> |
48 <td><a href="#AsyncPendingWrite">AsyncPendingWrite</a></td> |
42 <td>Module function to check for data to be written.</td> |
49 <td>Module function to check for data to be written.</td> |
43 </tr> |
50 </tr> |
44 </table> |
51 </table> |
45 <hr /><hr /> |
52 <hr /> |
|
53 <hr /> |
46 <a NAME="AsyncFile" ID="AsyncFile"></a> |
54 <a NAME="AsyncFile" ID="AsyncFile"></a> |
47 <h2>AsyncFile</h2> |
55 <h2>AsyncFile</h2> |
|
56 |
48 <p> |
57 <p> |
49 Class wrapping a socket object with a file interface. |
58 Class wrapping a socket object with a file interface. |
50 </p> |
59 </p> |
51 <h3>Derived from</h3> |
60 <h3>Derived from</h3> |
52 object |
61 object |
53 <h3>Class Attributes</h3> |
62 <h3>Class Attributes</h3> |
|
63 |
54 <table> |
64 <table> |
55 <tr><td>maxtries</td></tr> |
65 <tr><td>maxtries</td></tr> |
56 </table> |
66 </table> |
57 <h3>Class Methods</h3> |
67 <h3>Class Methods</h3> |
|
68 |
58 <table> |
69 <table> |
59 <tr><td>None</td></tr> |
70 <tr><td>None</td></tr> |
60 </table> |
71 </table> |
61 <h3>Methods</h3> |
72 <h3>Methods</h3> |
|
73 |
62 <table> |
74 <table> |
|
75 |
63 <tr> |
76 <tr> |
64 <td><a href="#AsyncFile.__init__">AsyncFile</a></td> |
77 <td><a href="#AsyncFile.__init__">AsyncFile</a></td> |
65 <td>Constructor</td> |
78 <td>Constructor</td> |
66 </tr><tr> |
79 </tr> |
|
80 <tr> |
67 <td><a href="#AsyncFile.__checkMode">__checkMode</a></td> |
81 <td><a href="#AsyncFile.__checkMode">__checkMode</a></td> |
68 <td>Private method to check the mode.</td> |
82 <td>Private method to check the mode.</td> |
69 </tr><tr> |
83 </tr> |
|
84 <tr> |
70 <td><a href="#AsyncFile.close">close</a></td> |
85 <td><a href="#AsyncFile.close">close</a></td> |
71 <td>Public method to close the file.</td> |
86 <td>Public method to close the file.</td> |
72 </tr><tr> |
87 </tr> |
|
88 <tr> |
73 <td><a href="#AsyncFile.fileno">fileno</a></td> |
89 <td><a href="#AsyncFile.fileno">fileno</a></td> |
74 <td>Public method returning the file number.</td> |
90 <td>Public method returning the file number.</td> |
75 </tr><tr> |
91 </tr> |
|
92 <tr> |
76 <td><a href="#AsyncFile.flush">flush</a></td> |
93 <td><a href="#AsyncFile.flush">flush</a></td> |
77 <td>Public method to write all pending entries.</td> |
94 <td>Public method to write all pending entries.</td> |
78 </tr><tr> |
95 </tr> |
|
96 <tr> |
79 <td><a href="#AsyncFile.isatty">isatty</a></td> |
97 <td><a href="#AsyncFile.isatty">isatty</a></td> |
80 <td>Public method to indicate whether a tty interface is supported.</td> |
98 <td>Public method to indicate whether a tty interface is supported.</td> |
81 </tr><tr> |
99 </tr> |
|
100 <tr> |
82 <td><a href="#AsyncFile.pendingWrite">pendingWrite</a></td> |
101 <td><a href="#AsyncFile.pendingWrite">pendingWrite</a></td> |
83 <td>Public method that returns the number of strings waiting to be written.</td> |
102 <td>Public method that returns the number of strings waiting to be written.</td> |
84 </tr><tr> |
103 </tr> |
|
104 <tr> |
85 <td><a href="#AsyncFile.read">read</a></td> |
105 <td><a href="#AsyncFile.read">read</a></td> |
86 <td>Public method to read bytes from this file.</td> |
106 <td>Public method to read bytes from this file.</td> |
87 </tr><tr> |
107 </tr> |
|
108 <tr> |
88 <td><a href="#AsyncFile.readCommand">readCommand</a></td> |
109 <td><a href="#AsyncFile.readCommand">readCommand</a></td> |
89 <td>Public method to read a length prefixed command string.</td> |
110 <td>Public method to read a length prefixed command string.</td> |
90 </tr><tr> |
111 </tr> |
|
112 <tr> |
91 <td><a href="#AsyncFile.read_p">read_p</a></td> |
113 <td><a href="#AsyncFile.read_p">read_p</a></td> |
92 <td>Public method to read bytes from this file.</td> |
114 <td>Public method to read bytes from this file.</td> |
93 </tr><tr> |
115 </tr> |
|
116 <tr> |
94 <td><a href="#AsyncFile.readable">readable</a></td> |
117 <td><a href="#AsyncFile.readable">readable</a></td> |
95 <td>Public method to check, if the stream is readable.</td> |
118 <td>Public method to check, if the stream is readable.</td> |
96 </tr><tr> |
119 </tr> |
|
120 <tr> |
97 <td><a href="#AsyncFile.readline">readline</a></td> |
121 <td><a href="#AsyncFile.readline">readline</a></td> |
98 <td>Public method to read one line from this file.</td> |
122 <td>Public method to read one line from this file.</td> |
99 </tr><tr> |
123 </tr> |
|
124 <tr> |
100 <td><a href="#AsyncFile.readline_p">readline_p</a></td> |
125 <td><a href="#AsyncFile.readline_p">readline_p</a></td> |
101 <td>Public method to read a line from this file.</td> |
126 <td>Public method to read a line from this file.</td> |
102 </tr><tr> |
127 </tr> |
|
128 <tr> |
103 <td><a href="#AsyncFile.readlines">readlines</a></td> |
129 <td><a href="#AsyncFile.readlines">readlines</a></td> |
104 <td>Public method to read all lines from this file.</td> |
130 <td>Public method to read all lines from this file.</td> |
105 </tr><tr> |
131 </tr> |
|
132 <tr> |
106 <td><a href="#AsyncFile.seek">seek</a></td> |
133 <td><a href="#AsyncFile.seek">seek</a></td> |
107 <td>Public method to move the filepointer.</td> |
134 <td>Public method to move the filepointer.</td> |
108 </tr><tr> |
135 </tr> |
|
136 <tr> |
109 <td><a href="#AsyncFile.seekable">seekable</a></td> |
137 <td><a href="#AsyncFile.seekable">seekable</a></td> |
110 <td>Public method to check, if the stream is seekable.</td> |
138 <td>Public method to check, if the stream is seekable.</td> |
111 </tr><tr> |
139 </tr> |
|
140 <tr> |
112 <td><a href="#AsyncFile.tell">tell</a></td> |
141 <td><a href="#AsyncFile.tell">tell</a></td> |
113 <td>Public method to get the filepointer position.</td> |
142 <td>Public method to get the filepointer position.</td> |
114 </tr><tr> |
143 </tr> |
|
144 <tr> |
115 <td><a href="#AsyncFile.truncate">truncate</a></td> |
145 <td><a href="#AsyncFile.truncate">truncate</a></td> |
116 <td>Public method to truncate the file.</td> |
146 <td>Public method to truncate the file.</td> |
117 </tr><tr> |
147 </tr> |
|
148 <tr> |
118 <td><a href="#AsyncFile.writable">writable</a></td> |
149 <td><a href="#AsyncFile.writable">writable</a></td> |
119 <td>Public method to check, if a stream is writable.</td> |
150 <td>Public method to check, if a stream is writable.</td> |
120 </tr><tr> |
151 </tr> |
|
152 <tr> |
121 <td><a href="#AsyncFile.write">write</a></td> |
153 <td><a href="#AsyncFile.write">write</a></td> |
122 <td>Public method to write a string to the file.</td> |
154 <td>Public method to write a string to the file.</td> |
123 </tr><tr> |
155 </tr> |
|
156 <tr> |
124 <td><a href="#AsyncFile.write_p">write_p</a></td> |
157 <td><a href="#AsyncFile.write_p">write_p</a></td> |
125 <td>Public method to write a json-rpc 2.0 coded string to the file.</td> |
158 <td>Public method to write a json-rpc 2.0 coded string to the file.</td> |
126 </tr><tr> |
159 </tr> |
|
160 <tr> |
127 <td><a href="#AsyncFile.writelines">writelines</a></td> |
161 <td><a href="#AsyncFile.writelines">writelines</a></td> |
128 <td>Public method to write a list of strings to the file.</td> |
162 <td>Public method to write a list of strings to the file.</td> |
129 </tr> |
163 </tr> |
130 </table> |
164 </table> |
131 <h3>Static Methods</h3> |
165 <h3>Static Methods</h3> |
|
166 |
132 <table> |
167 <table> |
133 <tr><td>None</td></tr> |
168 <tr><td>None</td></tr> |
134 </table> |
169 </table> |
|
170 |
135 <a NAME="AsyncFile.__init__" ID="AsyncFile.__init__"></a> |
171 <a NAME="AsyncFile.__init__" ID="AsyncFile.__init__"></a> |
136 <h4>AsyncFile (Constructor)</h4> |
172 <h4>AsyncFile (Constructor)</h4> |
137 <b>AsyncFile</b>(<i>sock, mode, name</i>) |
173 <b>AsyncFile</b>(<i>sock, mode, name</i>) |
|
174 |
138 <p> |
175 <p> |
139 Constructor |
176 Constructor |
140 </p><dl> |
177 </p> |
|
178 <dl> |
|
179 |
141 <dt><i>sock</i> (socket)</dt> |
180 <dt><i>sock</i> (socket)</dt> |
142 <dd> |
181 <dd> |
143 the socket object being wrapped |
182 the socket object being wrapped |
144 </dd><dt><i>mode</i> (str)</dt> |
183 </dd> |
|
184 <dt><i>mode</i> (str)</dt> |
145 <dd> |
185 <dd> |
146 mode of this file |
186 mode of this file |
147 </dd><dt><i>name</i> (str)</dt> |
187 </dd> |
|
188 <dt><i>name</i> (str)</dt> |
148 <dd> |
189 <dd> |
149 name of this file |
190 name of this file |
150 </dd> |
191 </dd> |
151 </dl><a NAME="AsyncFile.__checkMode" ID="AsyncFile.__checkMode"></a> |
192 </dl> |
|
193 <a NAME="AsyncFile.__checkMode" ID="AsyncFile.__checkMode"></a> |
152 <h4>AsyncFile.__checkMode</h4> |
194 <h4>AsyncFile.__checkMode</h4> |
153 <b>__checkMode</b>(<i>mode</i>) |
195 <b>__checkMode</b>(<i>mode</i>) |
|
196 |
154 <p> |
197 <p> |
155 Private method to check the mode. |
198 Private method to check the mode. |
156 </p><p> |
199 </p> |
|
200 <p> |
157 This method checks, if an operation is permitted according to |
201 This method checks, if an operation is permitted according to |
158 the mode of the file. If it is not, an IOError is raised. |
202 the mode of the file. If it is not, an IOError is raised. |
159 </p><dl> |
203 </p> |
|
204 <dl> |
|
205 |
160 <dt><i>mode</i> (string)</dt> |
206 <dt><i>mode</i> (string)</dt> |
161 <dd> |
207 <dd> |
162 the mode to be checked |
208 the mode to be checked |
163 </dd> |
209 </dd> |
164 </dl><dl> |
210 </dl> |
|
211 <dl> |
|
212 |
165 <dt>Raises <b>IOError</b>:</dt> |
213 <dt>Raises <b>IOError</b>:</dt> |
166 <dd> |
214 <dd> |
167 raised to indicate a bad file descriptor |
215 raised to indicate a bad file descriptor |
168 </dd> |
216 </dd> |
169 </dl><a NAME="AsyncFile.close" ID="AsyncFile.close"></a> |
217 </dl> |
|
218 <a NAME="AsyncFile.close" ID="AsyncFile.close"></a> |
170 <h4>AsyncFile.close</h4> |
219 <h4>AsyncFile.close</h4> |
171 <b>close</b>(<i>closeit=False</i>) |
220 <b>close</b>(<i>closeit=False</i>) |
|
221 |
172 <p> |
222 <p> |
173 Public method to close the file. |
223 Public method to close the file. |
174 </p><dl> |
224 </p> |
|
225 <dl> |
|
226 |
175 <dt><i>closeit</i> (bool)</dt> |
227 <dt><i>closeit</i> (bool)</dt> |
176 <dd> |
228 <dd> |
177 flag to indicate a close ordered by the debugger code |
229 flag to indicate a close ordered by the debugger code |
178 </dd> |
230 </dd> |
179 </dl><a NAME="AsyncFile.fileno" ID="AsyncFile.fileno"></a> |
231 </dl> |
|
232 <a NAME="AsyncFile.fileno" ID="AsyncFile.fileno"></a> |
180 <h4>AsyncFile.fileno</h4> |
233 <h4>AsyncFile.fileno</h4> |
181 <b>fileno</b>(<i></i>) |
234 <b>fileno</b>(<i></i>) |
|
235 |
182 <p> |
236 <p> |
183 Public method returning the file number. |
237 Public method returning the file number. |
184 </p><dl> |
238 </p> |
|
239 <dl> |
185 <dt>Returns:</dt> |
240 <dt>Returns:</dt> |
186 <dd> |
241 <dd> |
187 file number |
242 file number |
188 </dd> |
243 </dd> |
189 </dl><dl> |
244 </dl> |
|
245 <dl> |
190 <dt>Return Type:</dt> |
246 <dt>Return Type:</dt> |
191 <dd> |
247 <dd> |
192 int |
248 int |
193 </dd> |
249 </dd> |
194 </dl><a NAME="AsyncFile.flush" ID="AsyncFile.flush"></a> |
250 </dl> |
|
251 <a NAME="AsyncFile.flush" ID="AsyncFile.flush"></a> |
195 <h4>AsyncFile.flush</h4> |
252 <h4>AsyncFile.flush</h4> |
196 <b>flush</b>(<i></i>) |
253 <b>flush</b>(<i></i>) |
|
254 |
197 <p> |
255 <p> |
198 Public method to write all pending entries. |
256 Public method to write all pending entries. |
199 </p><a NAME="AsyncFile.isatty" ID="AsyncFile.isatty"></a> |
257 </p> |
|
258 <a NAME="AsyncFile.isatty" ID="AsyncFile.isatty"></a> |
200 <h4>AsyncFile.isatty</h4> |
259 <h4>AsyncFile.isatty</h4> |
201 <b>isatty</b>(<i></i>) |
260 <b>isatty</b>(<i></i>) |
|
261 |
202 <p> |
262 <p> |
203 Public method to indicate whether a tty interface is supported. |
263 Public method to indicate whether a tty interface is supported. |
204 </p><dl> |
264 </p> |
|
265 <dl> |
205 <dt>Returns:</dt> |
266 <dt>Returns:</dt> |
206 <dd> |
267 <dd> |
207 always false |
268 always false |
208 </dd> |
269 </dd> |
209 </dl><dl> |
270 </dl> |
|
271 <dl> |
210 <dt>Return Type:</dt> |
272 <dt>Return Type:</dt> |
211 <dd> |
273 <dd> |
212 bool |
274 bool |
213 </dd> |
275 </dd> |
214 </dl><a NAME="AsyncFile.pendingWrite" ID="AsyncFile.pendingWrite"></a> |
276 </dl> |
|
277 <a NAME="AsyncFile.pendingWrite" ID="AsyncFile.pendingWrite"></a> |
215 <h4>AsyncFile.pendingWrite</h4> |
278 <h4>AsyncFile.pendingWrite</h4> |
216 <b>pendingWrite</b>(<i></i>) |
279 <b>pendingWrite</b>(<i></i>) |
|
280 |
217 <p> |
281 <p> |
218 Public method that returns the number of strings waiting to be written. |
282 Public method that returns the number of strings waiting to be written. |
219 </p><dl> |
283 </p> |
|
284 <dl> |
220 <dt>Returns:</dt> |
285 <dt>Returns:</dt> |
221 <dd> |
286 <dd> |
222 the number of strings to be written |
287 the number of strings to be written |
223 </dd> |
288 </dd> |
224 </dl><dl> |
289 </dl> |
|
290 <dl> |
225 <dt>Return Type:</dt> |
291 <dt>Return Type:</dt> |
226 <dd> |
292 <dd> |
227 int |
293 int |
228 </dd> |
294 </dd> |
229 </dl><a NAME="AsyncFile.read" ID="AsyncFile.read"></a> |
295 </dl> |
|
296 <a NAME="AsyncFile.read" ID="AsyncFile.read"></a> |
230 <h4>AsyncFile.read</h4> |
297 <h4>AsyncFile.read</h4> |
231 <b>read</b>(<i>size=-1</i>) |
298 <b>read</b>(<i>size=-1</i>) |
|
299 |
232 <p> |
300 <p> |
233 Public method to read bytes from this file. |
301 Public method to read bytes from this file. |
234 </p><dl> |
302 </p> |
|
303 <dl> |
|
304 |
235 <dt><i>size</i> (int)</dt> |
305 <dt><i>size</i> (int)</dt> |
236 <dd> |
306 <dd> |
237 maximum number of bytes to be read |
307 maximum number of bytes to be read |
238 </dd> |
308 </dd> |
239 </dl><dl> |
309 </dl> |
|
310 <dl> |
240 <dt>Returns:</dt> |
311 <dt>Returns:</dt> |
241 <dd> |
312 <dd> |
242 the bytes read |
313 the bytes read |
243 </dd> |
314 </dd> |
244 </dl><dl> |
315 </dl> |
|
316 <dl> |
245 <dt>Return Type:</dt> |
317 <dt>Return Type:</dt> |
246 <dd> |
318 <dd> |
247 str |
319 str |
248 </dd> |
320 </dd> |
249 </dl><a NAME="AsyncFile.readCommand" ID="AsyncFile.readCommand"></a> |
321 </dl> |
|
322 <a NAME="AsyncFile.readCommand" ID="AsyncFile.readCommand"></a> |
250 <h4>AsyncFile.readCommand</h4> |
323 <h4>AsyncFile.readCommand</h4> |
251 <b>readCommand</b>(<i></i>) |
324 <b>readCommand</b>(<i></i>) |
|
325 |
252 <p> |
326 <p> |
253 Public method to read a length prefixed command string. |
327 Public method to read a length prefixed command string. |
254 </p><dl> |
328 </p> |
|
329 <dl> |
255 <dt>Returns:</dt> |
330 <dt>Returns:</dt> |
256 <dd> |
331 <dd> |
257 command string |
332 command string |
258 </dd> |
333 </dd> |
259 </dl><dl> |
334 </dl> |
|
335 <dl> |
260 <dt>Return Type:</dt> |
336 <dt>Return Type:</dt> |
261 <dd> |
337 <dd> |
262 str |
338 str |
263 </dd> |
339 </dd> |
264 </dl><a NAME="AsyncFile.read_p" ID="AsyncFile.read_p"></a> |
340 </dl> |
|
341 <a NAME="AsyncFile.read_p" ID="AsyncFile.read_p"></a> |
265 <h4>AsyncFile.read_p</h4> |
342 <h4>AsyncFile.read_p</h4> |
266 <b>read_p</b>(<i>size=-1</i>) |
343 <b>read_p</b>(<i>size=-1</i>) |
|
344 |
267 <p> |
345 <p> |
268 Public method to read bytes from this file. |
346 Public method to read bytes from this file. |
269 </p><dl> |
347 </p> |
|
348 <dl> |
|
349 |
270 <dt><i>size</i> (int)</dt> |
350 <dt><i>size</i> (int)</dt> |
271 <dd> |
351 <dd> |
272 maximum number of bytes to be read |
352 maximum number of bytes to be read |
273 </dd> |
353 </dd> |
274 </dl><dl> |
354 </dl> |
|
355 <dl> |
275 <dt>Returns:</dt> |
356 <dt>Returns:</dt> |
276 <dd> |
357 <dd> |
277 the bytes read |
358 the bytes read |
278 </dd> |
359 </dd> |
279 </dl><dl> |
360 </dl> |
|
361 <dl> |
280 <dt>Return Type:</dt> |
362 <dt>Return Type:</dt> |
281 <dd> |
363 <dd> |
282 str |
364 str |
283 </dd> |
365 </dd> |
284 </dl><a NAME="AsyncFile.readable" ID="AsyncFile.readable"></a> |
366 </dl> |
|
367 <a NAME="AsyncFile.readable" ID="AsyncFile.readable"></a> |
285 <h4>AsyncFile.readable</h4> |
368 <h4>AsyncFile.readable</h4> |
286 <b>readable</b>(<i></i>) |
369 <b>readable</b>(<i></i>) |
|
370 |
287 <p> |
371 <p> |
288 Public method to check, if the stream is readable. |
372 Public method to check, if the stream is readable. |
289 </p><dl> |
373 </p> |
|
374 <dl> |
290 <dt>Returns:</dt> |
375 <dt>Returns:</dt> |
291 <dd> |
376 <dd> |
292 flag indicating a readable stream |
377 flag indicating a readable stream |
293 </dd> |
378 </dd> |
294 </dl><dl> |
379 </dl> |
|
380 <dl> |
295 <dt>Return Type:</dt> |
381 <dt>Return Type:</dt> |
296 <dd> |
382 <dd> |
297 bool |
383 bool |
298 </dd> |
384 </dd> |
299 </dl><a NAME="AsyncFile.readline" ID="AsyncFile.readline"></a> |
385 </dl> |
|
386 <a NAME="AsyncFile.readline" ID="AsyncFile.readline"></a> |
300 <h4>AsyncFile.readline</h4> |
387 <h4>AsyncFile.readline</h4> |
301 <b>readline</b>(<i>sizehint=-1</i>) |
388 <b>readline</b>(<i>sizehint=-1</i>) |
|
389 |
302 <p> |
390 <p> |
303 Public method to read one line from this file. |
391 Public method to read one line from this file. |
304 </p><dl> |
392 </p> |
|
393 <dl> |
|
394 |
305 <dt><i>sizehint</i> (int)</dt> |
395 <dt><i>sizehint</i> (int)</dt> |
306 <dd> |
396 <dd> |
307 hint of the numbers of bytes to be read |
397 hint of the numbers of bytes to be read |
308 </dd> |
398 </dd> |
309 </dl><dl> |
399 </dl> |
|
400 <dl> |
310 <dt>Returns:</dt> |
401 <dt>Returns:</dt> |
311 <dd> |
402 <dd> |
312 one line read |
403 one line read |
313 </dd> |
404 </dd> |
314 </dl><dl> |
405 </dl> |
|
406 <dl> |
315 <dt>Return Type:</dt> |
407 <dt>Return Type:</dt> |
316 <dd> |
408 <dd> |
317 str |
409 str |
318 </dd> |
410 </dd> |
319 </dl><a NAME="AsyncFile.readline_p" ID="AsyncFile.readline_p"></a> |
411 </dl> |
|
412 <a NAME="AsyncFile.readline_p" ID="AsyncFile.readline_p"></a> |
320 <h4>AsyncFile.readline_p</h4> |
413 <h4>AsyncFile.readline_p</h4> |
321 <b>readline_p</b>(<i>size=-1</i>) |
414 <b>readline_p</b>(<i>size=-1</i>) |
|
415 |
322 <p> |
416 <p> |
323 Public method to read a line from this file. |
417 Public method to read a line from this file. |
324 </p><p> |
418 </p> |
|
419 <p> |
325 <b>Note</b>: This method will not block and may return |
420 <b>Note</b>: This method will not block and may return |
326 only a part of a line if that is all that is available. |
421 only a part of a line if that is all that is available. |
327 </p><dl> |
422 </p> |
|
423 <dl> |
|
424 |
328 <dt><i>size</i> (int)</dt> |
425 <dt><i>size</i> (int)</dt> |
329 <dd> |
426 <dd> |
330 maximum number of bytes to be read |
427 maximum number of bytes to be read |
331 </dd> |
428 </dd> |
332 </dl><dl> |
429 </dl> |
|
430 <dl> |
333 <dt>Returns:</dt> |
431 <dt>Returns:</dt> |
334 <dd> |
432 <dd> |
335 one line of text up to size bytes |
433 one line of text up to size bytes |
336 </dd> |
434 </dd> |
337 </dl><dl> |
435 </dl> |
|
436 <dl> |
338 <dt>Return Type:</dt> |
437 <dt>Return Type:</dt> |
339 <dd> |
438 <dd> |
340 str |
439 str |
341 </dd> |
440 </dd> |
342 </dl><a NAME="AsyncFile.readlines" ID="AsyncFile.readlines"></a> |
441 </dl> |
|
442 <a NAME="AsyncFile.readlines" ID="AsyncFile.readlines"></a> |
343 <h4>AsyncFile.readlines</h4> |
443 <h4>AsyncFile.readlines</h4> |
344 <b>readlines</b>(<i>sizehint=-1</i>) |
444 <b>readlines</b>(<i>sizehint=-1</i>) |
|
445 |
345 <p> |
446 <p> |
346 Public method to read all lines from this file. |
447 Public method to read all lines from this file. |
347 </p><dl> |
448 </p> |
|
449 <dl> |
|
450 |
348 <dt><i>sizehint</i> (int)</dt> |
451 <dt><i>sizehint</i> (int)</dt> |
349 <dd> |
452 <dd> |
350 hint of the numbers of bytes to be read |
453 hint of the numbers of bytes to be read |
351 </dd> |
454 </dd> |
352 </dl><dl> |
455 </dl> |
|
456 <dl> |
353 <dt>Returns:</dt> |
457 <dt>Returns:</dt> |
354 <dd> |
458 <dd> |
355 list of lines read |
459 list of lines read |
356 </dd> |
460 </dd> |
357 </dl><dl> |
461 </dl> |
|
462 <dl> |
358 <dt>Return Type:</dt> |
463 <dt>Return Type:</dt> |
359 <dd> |
464 <dd> |
360 list of str |
465 list of str |
361 </dd> |
466 </dd> |
362 </dl><a NAME="AsyncFile.seek" ID="AsyncFile.seek"></a> |
467 </dl> |
|
468 <a NAME="AsyncFile.seek" ID="AsyncFile.seek"></a> |
363 <h4>AsyncFile.seek</h4> |
469 <h4>AsyncFile.seek</h4> |
364 <b>seek</b>(<i>offset, whence=0</i>) |
470 <b>seek</b>(<i>offset, whence=0</i>) |
|
471 |
365 <p> |
472 <p> |
366 Public method to move the filepointer. |
473 Public method to move the filepointer. |
367 </p><dl> |
474 </p> |
|
475 <dl> |
|
476 |
368 <dt><i>offset</i> (int)</dt> |
477 <dt><i>offset</i> (int)</dt> |
369 <dd> |
478 <dd> |
370 offset to move the filepointer to |
479 offset to move the filepointer to |
371 </dd><dt><i>whence</i> (int)</dt> |
480 </dd> |
|
481 <dt><i>whence</i> (int)</dt> |
372 <dd> |
482 <dd> |
373 position the offset relates to |
483 position the offset relates to |
374 </dd> |
484 </dd> |
375 </dl><dl> |
485 </dl> |
|
486 <dl> |
|
487 |
376 <dt>Raises <b>IOError</b>:</dt> |
488 <dt>Raises <b>IOError</b>:</dt> |
377 <dd> |
489 <dd> |
378 This method is not supported and always raises an |
490 This method is not supported and always raises an |
379 IOError. |
491 IOError. |
380 </dd> |
492 </dd> |
381 </dl><a NAME="AsyncFile.seekable" ID="AsyncFile.seekable"></a> |
493 </dl> |
|
494 <a NAME="AsyncFile.seekable" ID="AsyncFile.seekable"></a> |
382 <h4>AsyncFile.seekable</h4> |
495 <h4>AsyncFile.seekable</h4> |
383 <b>seekable</b>(<i></i>) |
496 <b>seekable</b>(<i></i>) |
|
497 |
384 <p> |
498 <p> |
385 Public method to check, if the stream is seekable. |
499 Public method to check, if the stream is seekable. |
386 </p><dl> |
500 </p> |
|
501 <dl> |
387 <dt>Returns:</dt> |
502 <dt>Returns:</dt> |
388 <dd> |
503 <dd> |
389 flag indicating a seekable stream |
504 flag indicating a seekable stream |
390 </dd> |
505 </dd> |
391 </dl><dl> |
506 </dl> |
|
507 <dl> |
392 <dt>Return Type:</dt> |
508 <dt>Return Type:</dt> |
393 <dd> |
509 <dd> |
394 bool |
510 bool |
395 </dd> |
511 </dd> |
396 </dl><a NAME="AsyncFile.tell" ID="AsyncFile.tell"></a> |
512 </dl> |
|
513 <a NAME="AsyncFile.tell" ID="AsyncFile.tell"></a> |
397 <h4>AsyncFile.tell</h4> |
514 <h4>AsyncFile.tell</h4> |
398 <b>tell</b>(<i></i>) |
515 <b>tell</b>(<i></i>) |
|
516 |
399 <p> |
517 <p> |
400 Public method to get the filepointer position. |
518 Public method to get the filepointer position. |
401 </p><dl> |
519 </p> |
|
520 <dl> |
|
521 |
402 <dt>Raises <b>IOError</b>:</dt> |
522 <dt>Raises <b>IOError</b>:</dt> |
403 <dd> |
523 <dd> |
404 This method is not supported and always raises an |
524 This method is not supported and always raises an |
405 IOError. |
525 IOError. |
406 </dd> |
526 </dd> |
407 </dl><a NAME="AsyncFile.truncate" ID="AsyncFile.truncate"></a> |
527 </dl> |
|
528 <a NAME="AsyncFile.truncate" ID="AsyncFile.truncate"></a> |
408 <h4>AsyncFile.truncate</h4> |
529 <h4>AsyncFile.truncate</h4> |
409 <b>truncate</b>(<i>size=-1</i>) |
530 <b>truncate</b>(<i>size=-1</i>) |
|
531 |
410 <p> |
532 <p> |
411 Public method to truncate the file. |
533 Public method to truncate the file. |
412 </p><dl> |
534 </p> |
|
535 <dl> |
|
536 |
413 <dt><i>size</i> (int)</dt> |
537 <dt><i>size</i> (int)</dt> |
414 <dd> |
538 <dd> |
415 size to truncate to |
539 size to truncate to |
416 </dd> |
540 </dd> |
417 </dl><dl> |
541 </dl> |
|
542 <dl> |
|
543 |
418 <dt>Raises <b>IOError</b>:</dt> |
544 <dt>Raises <b>IOError</b>:</dt> |
419 <dd> |
545 <dd> |
420 This method is not supported and always raises an |
546 This method is not supported and always raises an |
421 IOError. |
547 IOError. |
422 </dd> |
548 </dd> |
423 </dl><a NAME="AsyncFile.writable" ID="AsyncFile.writable"></a> |
549 </dl> |
|
550 <a NAME="AsyncFile.writable" ID="AsyncFile.writable"></a> |
424 <h4>AsyncFile.writable</h4> |
551 <h4>AsyncFile.writable</h4> |
425 <b>writable</b>(<i></i>) |
552 <b>writable</b>(<i></i>) |
|
553 |
426 <p> |
554 <p> |
427 Public method to check, if a stream is writable. |
555 Public method to check, if a stream is writable. |
428 </p><dl> |
556 </p> |
|
557 <dl> |
429 <dt>Returns:</dt> |
558 <dt>Returns:</dt> |
430 <dd> |
559 <dd> |
431 flag indicating a writable stream |
560 flag indicating a writable stream |
432 </dd> |
561 </dd> |
433 </dl><dl> |
562 </dl> |
|
563 <dl> |
434 <dt>Return Type:</dt> |
564 <dt>Return Type:</dt> |
435 <dd> |
565 <dd> |
436 bool |
566 bool |
437 </dd> |
567 </dd> |
438 </dl><a NAME="AsyncFile.write" ID="AsyncFile.write"></a> |
568 </dl> |
|
569 <a NAME="AsyncFile.write" ID="AsyncFile.write"></a> |
439 <h4>AsyncFile.write</h4> |
570 <h4>AsyncFile.write</h4> |
440 <b>write</b>(<i>s</i>) |
571 <b>write</b>(<i>s</i>) |
|
572 |
441 <p> |
573 <p> |
442 Public method to write a string to the file. |
574 Public method to write a string to the file. |
443 </p><dl> |
575 </p> |
|
576 <dl> |
|
577 |
444 <dt><i>s</i> (str)</dt> |
578 <dt><i>s</i> (str)</dt> |
445 <dd> |
579 <dd> |
446 text to be written |
580 text to be written |
447 </dd> |
581 </dd> |
448 </dl><a NAME="AsyncFile.write_p" ID="AsyncFile.write_p"></a> |
582 </dl> |
|
583 <a NAME="AsyncFile.write_p" ID="AsyncFile.write_p"></a> |
449 <h4>AsyncFile.write_p</h4> |
584 <h4>AsyncFile.write_p</h4> |
450 <b>write_p</b>(<i>s</i>) |
585 <b>write_p</b>(<i>s</i>) |
|
586 |
451 <p> |
587 <p> |
452 Public method to write a json-rpc 2.0 coded string to the file. |
588 Public method to write a json-rpc 2.0 coded string to the file. |
453 </p><dl> |
589 </p> |
|
590 <dl> |
|
591 |
454 <dt><i>s</i> (str)</dt> |
592 <dt><i>s</i> (str)</dt> |
455 <dd> |
593 <dd> |
456 text to be written |
594 text to be written |
457 </dd> |
595 </dd> |
458 </dl><a NAME="AsyncFile.writelines" ID="AsyncFile.writelines"></a> |
596 </dl> |
|
597 <a NAME="AsyncFile.writelines" ID="AsyncFile.writelines"></a> |
459 <h4>AsyncFile.writelines</h4> |
598 <h4>AsyncFile.writelines</h4> |
460 <b>writelines</b>(<i>lines</i>) |
599 <b>writelines</b>(<i>lines</i>) |
|
600 |
461 <p> |
601 <p> |
462 Public method to write a list of strings to the file. |
602 Public method to write a list of strings to the file. |
463 </p><dl> |
603 </p> |
|
604 <dl> |
|
605 |
464 <dt><i>lines</i> (list of str)</dt> |
606 <dt><i>lines</i> (list of str)</dt> |
465 <dd> |
607 <dd> |
466 list of texts to be written |
608 list of texts to be written |
467 </dd> |
609 </dd> |
468 </dl> |
610 </dl> |
469 <div align="right"><a href="#top">Up</a></div> |
611 <div align="right"><a href="#top">Up</a></div> |
470 <hr /><hr /> |
612 <hr /> |
|
613 <hr /> |
471 <a NAME="AsyncPendingWrite" ID="AsyncPendingWrite"></a> |
614 <a NAME="AsyncPendingWrite" ID="AsyncPendingWrite"></a> |
472 <h2>AsyncPendingWrite</h2> |
615 <h2>AsyncPendingWrite</h2> |
473 <b>AsyncPendingWrite</b>(<i>file</i>) |
616 <b>AsyncPendingWrite</b>(<i>file</i>) |
|
617 |
474 <p> |
618 <p> |
475 Module function to check for data to be written. |
619 Module function to check for data to be written. |
476 </p><dl> |
620 </p> |
|
621 <dl> |
|
622 |
477 <dt><i>file</i> (file)</dt> |
623 <dt><i>file</i> (file)</dt> |
478 <dd> |
624 <dd> |
479 The file object to be checked |
625 The file object to be checked |
480 </dd> |
626 </dd> |
481 </dl><dl> |
627 </dl> |
|
628 <dl> |
482 <dt>Returns:</dt> |
629 <dt>Returns:</dt> |
483 <dd> |
630 <dd> |
484 Flag indicating if there is data waiting |
631 Flag indicating if there is data waiting |
485 </dd> |
632 </dd> |
486 </dl><dl> |
633 </dl> |
|
634 <dl> |
487 <dt>Return Type:</dt> |
635 <dt>Return Type:</dt> |
488 <dd> |
636 <dd> |
489 int |
637 int |
490 </dd> |
638 </dd> |
491 </dl> |
639 </dl> |