eric6/Documentation/Source/eric6.DebugClients.Python.DebugUtilities.html

branch
maintenance
changeset 8043
0acf98cd089a
parent 7989
a21d673a8f99
equal deleted inserted replaced
7991:866adc8c315b 8043:0acf98cd089a
26 Module implementing utilities functions for the debug client. 26 Module implementing utilities functions for the debug client.
27 </p> 27 </p>
28 <h3>Global Attributes</h3> 28 <h3>Global Attributes</h3>
29 29
30 <table> 30 <table>
31 <tr><td>ArgInfo</td></tr> 31 <tr><td>ArgInfo</td></tr><tr><td>PYTHON_NAMES</td></tr>
32 </table> 32 </table>
33 <h3>Classes</h3> 33 <h3>Classes</h3>
34 34
35 <table> 35 <table>
36 <tr><td>None</td></tr> 36 <tr><td>None</td></tr>
50 <tr> 50 <tr>
51 <td><a href="#getargvalues">getargvalues</a></td> 51 <td><a href="#getargvalues">getargvalues</a></td>
52 <td>Function to get information about arguments passed into a particular frame.</td> 52 <td>Function to get information about arguments passed into a particular frame.</td>
53 </tr> 53 </tr>
54 <tr> 54 <tr>
55 <td><a href="#isExecutable">isExecutable</a></td>
56 <td>Function to check, if the given program is executable.</td>
57 </tr>
58 <tr>
59 <td><a href="#isPythonProgram">isPythonProgram</a></td>
60 <td>Function to check, if the given program is a Python interpreter or program.</td>
61 </tr>
62 <tr>
63 <td><a href="#isWindowsPlatform">isWindowsPlatform</a></td>
64 <td>Function to check, if this is a Windows platform.</td>
65 </tr>
66 <tr>
67 <td><a href="#patchArgumentStringWindows">patchArgumentStringWindows</a></td>
68 <td>Function to patch an argument string for Windows.</td>
69 </tr>
70 <tr>
71 <td><a href="#patchArguments">patchArguments</a></td>
72 <td>Function to patch the arguments given to start a program in order to execute it in our debugger.</td>
73 </tr>
74 <tr>
55 <td><a href="#prepareJsonCommand">prepareJsonCommand</a></td> 75 <td><a href="#prepareJsonCommand">prepareJsonCommand</a></td>
56 <td>Function to prepare a single command or response for transmission to the IDE.</td> 76 <td>Function to prepare a single command or response for transmission to the IDE.</td>
77 </tr>
78 <tr>
79 <td><a href="#quoteArgs">quoteArgs</a></td>
80 <td>Function to quote the given list of arguments.</td>
81 </tr>
82 <tr>
83 <td><a href="#removeQuotesFromArgs">removeQuotesFromArgs</a></td>
84 <td>Function to remove quotes from the arguments list.</td>
85 </tr>
86 <tr>
87 <td><a href="#startsWithShebang">startsWithShebang</a></td>
88 <td>Function to check, if the given program start with a Shebang line.</td>
89 </tr>
90 <tr>
91 <td><a href="#stringToArgumentsWindows">stringToArgumentsWindows</a></td>
92 <td>Function to prepare a string of arguments for Windows platform.</td>
57 </tr> 93 </tr>
58 </table> 94 </table>
59 <hr /> 95 <hr />
60 <hr /> 96 <hr />
61 <a NAME="_getfullargs" ID="_getfullargs"></a> 97 <a NAME="_getfullargs" ID="_getfullargs"></a>
72 <dd> 108 <dd>
73 reference to a code object to be processed 109 reference to a code object to be processed
74 </dd> 110 </dd>
75 </dl> 111 </dl>
76 <dl> 112 <dl>
77 <dt>Returns:</dt> 113 <dt>Return:</dt>
78 <dd> 114 <dd>
79 tuple of four things, where 'args' and 'kwonlyargs' are lists of 115 tuple of four things, where 'args' and 'kwonlyargs' are lists of
80 argument names, and 'varargs' and 'varkw' are the names of the 116 argument names, and 'varargs' and 'varkw' are the names of the
81 * and ** arguments or None. 117 * and ** arguments or None.
82 </dd> 118 </dd>
115 </dd> 151 </dd>
116 <dt><i>localsDict</i> (dict)</dt> 152 <dt><i>localsDict</i> (dict)</dt>
117 <dd> 153 <dd>
118 reference to the local variables dictionary 154 reference to the local variables dictionary
119 </dd> 155 </dd>
120 <dt><i>formatarg=</i> (func)</dt> 156 <dt><i>formatarg</i> (func)</dt>
121 <dd> 157 <dd>
122 argument formatting function 158 argument formatting function
123 </dd> 159 </dd>
124 <dt><i>formatvarargs=</i> (func)</dt> 160 <dt><i>formatvarargs</i> (func)</dt>
125 <dd> 161 <dd>
126 variable arguments formatting function 162 variable arguments formatting function
127 </dd> 163 </dd>
128 <dt><i>formatvarkw=</i> (func)</dt> 164 <dt><i>formatvarkw</i> (func)</dt>
129 <dd> 165 <dd>
130 keyword arguments formatting function 166 keyword arguments formatting function
131 </dd> 167 </dd>
132 <dt><i>formatvalue=</i> (func)</dt> 168 <dt><i>formatvalue</i> (func)</dt>
133 <dd> 169 <dd>
134 value formating functtion 170 value formating functtion
135 </dd> 171 </dd>
136 </dl> 172 </dl>
137 <dl> 173 <dl>
138 <dt>Returns:</dt> 174 <dt>Return:</dt>
139 <dd> 175 <dd>
140 formatted call signature 176 formatted call signature
141 </dd> 177 </dd>
142 </dl> 178 </dl>
143 <dl> 179 <dl>
163 <dd> 199 <dd>
164 reference to a frame object to be processed 200 reference to a frame object to be processed
165 </dd> 201 </dd>
166 </dl> 202 </dl>
167 <dl> 203 <dl>
168 <dt>Returns:</dt> 204 <dt>Return:</dt>
169 <dd> 205 <dd>
170 tuple of four things, where 'args' is a list of the argument names, 206 tuple of four things, where 'args' is a list of the argument names,
171 'varargs' and 'varkw' are the names of the * and ** arguments or None 207 'varargs' and 'varkw' are the names of the * and ** arguments or None
172 and 'locals' is the locals dictionary of the given frame. 208 and 'locals' is the locals dictionary of the given frame.
173 </dd> 209 </dd>
180 </dd> 216 </dd>
181 </dl> 217 </dl>
182 <div align="right"><a href="#top">Up</a></div> 218 <div align="right"><a href="#top">Up</a></div>
183 <hr /> 219 <hr />
184 <hr /> 220 <hr />
221 <a NAME="isExecutable" ID="isExecutable"></a>
222 <h2>isExecutable</h2>
223 <b>isExecutable</b>(<i>program</i>)
224
225 <p>
226 Function to check, if the given program is executable.
227 </p>
228 <dl>
229
230 <dt><i>program</i> (str)</dt>
231 <dd>
232 program path to be checked
233 </dd>
234 </dl>
235 <dl>
236 <dt>Return:</dt>
237 <dd>
238 flag indicating an executable program
239 </dd>
240 </dl>
241 <dl>
242 <dt>Return Type:</dt>
243 <dd>
244 bool
245 </dd>
246 </dl>
247 <div align="right"><a href="#top">Up</a></div>
248 <hr />
249 <hr />
250 <a NAME="isPythonProgram" ID="isPythonProgram"></a>
251 <h2>isPythonProgram</h2>
252 <b>isPythonProgram</b>(<i>program</i>)
253
254 <p>
255 Function to check, if the given program is a Python interpreter or
256 program.
257 </p>
258 <dl>
259
260 <dt><i>program</i> (str)</dt>
261 <dd>
262 program to be checked
263 </dd>
264 </dl>
265 <dl>
266 <dt>Return:</dt>
267 <dd>
268 flag indicating a Python interpreter or program
269 </dd>
270 </dl>
271 <dl>
272 <dt>Return Type:</dt>
273 <dd>
274 bool
275 </dd>
276 </dl>
277 <div align="right"><a href="#top">Up</a></div>
278 <hr />
279 <hr />
280 <a NAME="isWindowsPlatform" ID="isWindowsPlatform"></a>
281 <h2>isWindowsPlatform</h2>
282 <b>isWindowsPlatform</b>(<i></i>)
283
284 <p>
285 Function to check, if this is a Windows platform.
286 </p>
287 <dl>
288 <dt>Return:</dt>
289 <dd>
290 flag indicating Windows platform
291 </dd>
292 </dl>
293 <dl>
294 <dt>Return Type:</dt>
295 <dd>
296 bool
297 </dd>
298 </dl>
299 <div align="right"><a href="#top">Up</a></div>
300 <hr />
301 <hr />
302 <a NAME="patchArgumentStringWindows" ID="patchArgumentStringWindows"></a>
303 <h2>patchArgumentStringWindows</h2>
304 <b>patchArgumentStringWindows</b>(<i>debugClient, argStr</i>)
305
306 <p>
307 Function to patch an argument string for Windows.
308 </p>
309 <dl>
310
311 <dt><i>debugClient</i> (DebugClient)</dt>
312 <dd>
313 reference to the debug client object
314 </dd>
315 <dt><i>argStr</i> (str)</dt>
316 <dd>
317 argument string
318 </dd>
319 </dl>
320 <dl>
321 <dt>Return:</dt>
322 <dd>
323 patched argument string
324 </dd>
325 </dl>
326 <dl>
327 <dt>Return Type:</dt>
328 <dd>
329 str
330 </dd>
331 </dl>
332 <div align="right"><a href="#top">Up</a></div>
333 <hr />
334 <hr />
335 <a NAME="patchArguments" ID="patchArguments"></a>
336 <h2>patchArguments</h2>
337 <b>patchArguments</b>(<i>debugClient, arguments, noRedirect=False</i>)
338
339 <p>
340 Function to patch the arguments given to start a program in order to
341 execute it in our debugger.
342 </p>
343 <dl>
344
345 <dt><i>debugClient</i> (DebugClient)</dt>
346 <dd>
347 reference to the debug client object
348 </dd>
349 <dt><i>arguments</i> (list of str)</dt>
350 <dd>
351 list of program arguments
352 </dd>
353 <dt><i>noRedirect</i> (bool)</dt>
354 <dd>
355 flag indicating to not redirect stdin and stdout
356 </dd>
357 </dl>
358 <dl>
359 <dt>Return:</dt>
360 <dd>
361 modified argument list
362 </dd>
363 </dl>
364 <dl>
365 <dt>Return Type:</dt>
366 <dd>
367 list of str
368 </dd>
369 </dl>
370 <div align="right"><a href="#top">Up</a></div>
371 <hr />
372 <hr />
185 <a NAME="prepareJsonCommand" ID="prepareJsonCommand"></a> 373 <a NAME="prepareJsonCommand" ID="prepareJsonCommand"></a>
186 <h2>prepareJsonCommand</h2> 374 <h2>prepareJsonCommand</h2>
187 <b>prepareJsonCommand</b>(<i>method, params</i>) 375 <b>prepareJsonCommand</b>(<i>method, params</i>)
188 376
189 <p> 377 <p>
200 <dd> 388 <dd>
201 dictionary of named parameters for the command or response 389 dictionary of named parameters for the command or response
202 </dd> 390 </dd>
203 </dl> 391 </dl>
204 <dl> 392 <dl>
205 <dt>Returns:</dt> 393 <dt>Return:</dt>
206 <dd> 394 <dd>
207 prepared JSON command or response string 395 prepared JSON command or response string
208 </dd> 396 </dd>
209 </dl> 397 </dl>
210 <dl> 398 <dl>
213 str 401 str
214 </dd> 402 </dd>
215 </dl> 403 </dl>
216 <div align="right"><a href="#top">Up</a></div> 404 <div align="right"><a href="#top">Up</a></div>
217 <hr /> 405 <hr />
406 <hr />
407 <a NAME="quoteArgs" ID="quoteArgs"></a>
408 <h2>quoteArgs</h2>
409 <b>quoteArgs</b>(<i>args</i>)
410
411 <p>
412 Function to quote the given list of arguments.
413 </p>
414 <dl>
415
416 <dt><i>args</i> (list of str)</dt>
417 <dd>
418 list of arguments to be quoted
419 </dd>
420 </dl>
421 <dl>
422 <dt>Return:</dt>
423 <dd>
424 list of quoted arguments
425 </dd>
426 </dl>
427 <dl>
428 <dt>Return Type:</dt>
429 <dd>
430 list of str
431 </dd>
432 </dl>
433 <div align="right"><a href="#top">Up</a></div>
434 <hr />
435 <hr />
436 <a NAME="removeQuotesFromArgs" ID="removeQuotesFromArgs"></a>
437 <h2>removeQuotesFromArgs</h2>
438 <b>removeQuotesFromArgs</b>(<i>args</i>)
439
440 <p>
441 Function to remove quotes from the arguments list.
442 </p>
443 <dl>
444
445 <dt><i>args</i> (list of str)</dt>
446 <dd>
447 list of arguments
448 </dd>
449 </dl>
450 <dl>
451 <dt>Return:</dt>
452 <dd>
453 list of unquoted strings
454 </dd>
455 </dl>
456 <dl>
457 <dt>Return Type:</dt>
458 <dd>
459 list of str
460 </dd>
461 </dl>
462 <div align="right"><a href="#top">Up</a></div>
463 <hr />
464 <hr />
465 <a NAME="startsWithShebang" ID="startsWithShebang"></a>
466 <h2>startsWithShebang</h2>
467 <b>startsWithShebang</b>(<i>program</i>)
468
469 <p>
470 Function to check, if the given program start with a Shebang line.
471 </p>
472 <dl>
473
474 <dt><i>program</i> (str)</dt>
475 <dd>
476 program path to be checked
477 </dd>
478 </dl>
479 <dl>
480 <dt>Return:</dt>
481 <dd>
482 flag indicating an existing and valid shebang line
483 </dd>
484 </dl>
485 <dl>
486 <dt>Return Type:</dt>
487 <dd>
488 bool
489 </dd>
490 </dl>
491 <div align="right"><a href="#top">Up</a></div>
492 <hr />
493 <hr />
494 <a NAME="stringToArgumentsWindows" ID="stringToArgumentsWindows"></a>
495 <h2>stringToArgumentsWindows</h2>
496 <b>stringToArgumentsWindows</b>(<i>args</i>)
497
498 <p>
499 Function to prepare a string of arguments for Windows platform.
500 </p>
501 <dl>
502
503 <dt><i>args</i> (str)</dt>
504 <dd>
505 list of command arguments
506 </dd>
507 </dl>
508 <dl>
509 <dt>Return:</dt>
510 <dd>
511 list of command arguments
512 </dd>
513 </dl>
514 <dl>
515 <dt>Return Type:</dt>
516 <dd>
517 list of str
518 </dd>
519 </dl>
520 <dl>
521
522 <dt>Raises <b>RuntimeError</b>:</dt>
523 <dd>
524 raised to indicate an illegal arguments parsing
525 condition
526 </dd>
527 </dl>
528 <div align="right"><a href="#top">Up</a></div>
529 <hr />
218 </body></html> 530 </body></html>

eric ide

mercurial