eric7/Documentation/Source/eric7.Plugins.CheckerPlugins.CodeStyleChecker.AstUtilities.html

branch
eric7
changeset 8372
e0227a7c850e
child 8596
d64760b2da50
equal deleted inserted replaced
8371:d6062691d424 8372:e0227a7c850e
1 <!DOCTYPE html>
2 <html><head>
3 <title>eric7.Plugins.CheckerPlugins.CodeStyleChecker.AstUtilities</title>
4 <meta charset="UTF-8">
5 <style>
6 body {
7 background: #EDECE6;
8 margin: 0em 1em 10em 1em;
9 color: black;
10 }
11
12 h1 { color: white; background: #85774A; }
13 h2 { color: white; background: #85774A; }
14 h3 { color: white; background: #9D936E; }
15 h4 { color: white; background: #9D936E; }
16
17 a { color: #BA6D36; }
18
19 </style>
20 </head>
21 <body>
22 <a NAME="top" ID="top"></a>
23 <h1>eric7.Plugins.CheckerPlugins.CodeStyleChecker.AstUtilities</h1>
24
25 <p>
26 Module implementing some utility and compatibility functions for working with
27 the ast module.
28 </p>
29 <h3>Global Attributes</h3>
30
31 <table>
32 <tr><td>None</td></tr>
33 </table>
34 <h3>Classes</h3>
35
36 <table>
37 <tr><td>None</td></tr>
38 </table>
39 <h3>Functions</h3>
40
41 <table>
42
43 <tr>
44 <td><a href="#getValue">getValue</a></td>
45 <td>Function to extract the value of a node.</td>
46 </tr>
47 <tr>
48 <td><a href="#getValue_1">getValue</a></td>
49 <td>Function to extract the value of a node.</td>
50 </tr>
51 <tr>
52 <td><a href="#isBaseString">isBaseString</a></td>
53 <td>Function to check that a node is a bytes or string.</td>
54 </tr>
55 <tr>
56 <td><a href="#isBaseString_1">isBaseString</a></td>
57 <td>Function to check that a node is a bytes or string.</td>
58 </tr>
59 <tr>
60 <td><a href="#isBytes">isBytes</a></td>
61 <td>Function to check that a node is a bytes.</td>
62 </tr>
63 <tr>
64 <td><a href="#isBytes_1">isBytes</a></td>
65 <td>Function to check that a node is a bytes.</td>
66 </tr>
67 <tr>
68 <td><a href="#isNameConstant">isNameConstant</a></td>
69 <td>Function to check that a node is a name constant.</td>
70 </tr>
71 <tr>
72 <td><a href="#isNameConstant_1">isNameConstant</a></td>
73 <td>Function to check that a node is a name constant.</td>
74 </tr>
75 <tr>
76 <td><a href="#isNumber">isNumber</a></td>
77 <td>Function to check that a node is a number.</td>
78 </tr>
79 <tr>
80 <td><a href="#isNumber_1">isNumber</a></td>
81 <td>Function to check that a node is a number.</td>
82 </tr>
83 <tr>
84 <td><a href="#isString">isString</a></td>
85 <td>Function to check that a node is a string.</td>
86 </tr>
87 <tr>
88 <td><a href="#isString_1">isString</a></td>
89 <td>Function to check that a node is a string.</td>
90 </tr>
91 </table>
92 <hr />
93 <hr />
94 <a NAME="getValue" ID="getValue"></a>
95 <h2>getValue</h2>
96 <b>getValue</b>(<i>node</i>)
97
98 <p>
99 Function to extract the value of a node.
100 </p>
101 <dl>
102
103 <dt><i>node</i> (ast.Constant)</dt>
104 <dd>
105 reference to the node to extract the value from
106 </dd>
107 </dl>
108 <dl>
109 <dt>Return:</dt>
110 <dd>
111 value of the node
112 </dd>
113 </dl>
114 <dl>
115 <dt>Return Type:</dt>
116 <dd>
117 any
118 </dd>
119 </dl>
120 <dl>
121
122 <dt>Raises <b>TypeError</b>:</dt>
123 <dd>
124 raised to indicate an unsupported type
125 </dd>
126 </dl>
127 <div align="right"><a href="#top">Up</a></div>
128 <hr />
129 <hr />
130 <a NAME="getValue_1" ID="getValue_1"></a>
131 <h2>getValue</h2>
132 <b>getValue</b>(<i>node</i>)
133
134 <p>
135 Function to extract the value of a node.
136 </p>
137 <dl>
138
139 <dt><i>node</i> (one of ast.Num, ast.Str, ast.Bytes or ast.NameConstant)</dt>
140 <dd>
141 reference to the node to extract the value from
142 </dd>
143 </dl>
144 <dl>
145 <dt>Return:</dt>
146 <dd>
147 value of the node
148 </dd>
149 </dl>
150 <dl>
151 <dt>Return Type:</dt>
152 <dd>
153 one of str, bytes, int
154 </dd>
155 </dl>
156 <dl>
157
158 <dt>Raises <b>TypeError</b>:</dt>
159 <dd>
160 raised to indicate an unsupported type
161 </dd>
162 </dl>
163 <div align="right"><a href="#top">Up</a></div>
164 <hr />
165 <hr />
166 <a NAME="isBaseString" ID="isBaseString"></a>
167 <h2>isBaseString</h2>
168 <b>isBaseString</b>(<i>node</i>)
169
170 <p>
171 Function to check that a node is a bytes or string.
172 </p>
173 <dl>
174
175 <dt><i>node</i> (ast.AST)</dt>
176 <dd>
177 reference to the node to check
178 </dd>
179 </dl>
180 <dl>
181 <dt>Return:</dt>
182 <dd>
183 flag indicating a bytes or string
184 </dd>
185 </dl>
186 <dl>
187 <dt>Return Type:</dt>
188 <dd>
189 bool
190 </dd>
191 </dl>
192 <div align="right"><a href="#top">Up</a></div>
193 <hr />
194 <hr />
195 <a NAME="isBaseString_1" ID="isBaseString_1"></a>
196 <h2>isBaseString</h2>
197 <b>isBaseString</b>(<i>node</i>)
198
199 <p>
200 Function to check that a node is a bytes or string.
201 </p>
202 <dl>
203
204 <dt><i>node</i> (ast.AST)</dt>
205 <dd>
206 reference to the node to check
207 </dd>
208 </dl>
209 <dl>
210 <dt>Return:</dt>
211 <dd>
212 flag indicating a bytes or string
213 </dd>
214 </dl>
215 <dl>
216 <dt>Return Type:</dt>
217 <dd>
218 bool
219 </dd>
220 </dl>
221 <div align="right"><a href="#top">Up</a></div>
222 <hr />
223 <hr />
224 <a NAME="isBytes" ID="isBytes"></a>
225 <h2>isBytes</h2>
226 <b>isBytes</b>(<i>node</i>)
227
228 <p>
229 Function to check that a node is a bytes.
230 </p>
231 <dl>
232
233 <dt><i>node</i> (ast.AST)</dt>
234 <dd>
235 reference to the node to check
236 </dd>
237 </dl>
238 <dl>
239 <dt>Return:</dt>
240 <dd>
241 flag indicating a bytes
242 </dd>
243 </dl>
244 <dl>
245 <dt>Return Type:</dt>
246 <dd>
247 bool
248 </dd>
249 </dl>
250 <div align="right"><a href="#top">Up</a></div>
251 <hr />
252 <hr />
253 <a NAME="isBytes_1" ID="isBytes_1"></a>
254 <h2>isBytes</h2>
255 <b>isBytes</b>(<i>node</i>)
256
257 <p>
258 Function to check that a node is a bytes.
259 </p>
260 <dl>
261
262 <dt><i>node</i> (ast.AST)</dt>
263 <dd>
264 reference to the node to check
265 </dd>
266 </dl>
267 <dl>
268 <dt>Return:</dt>
269 <dd>
270 flag indicating a bytes
271 </dd>
272 </dl>
273 <dl>
274 <dt>Return Type:</dt>
275 <dd>
276 bool
277 </dd>
278 </dl>
279 <div align="right"><a href="#top">Up</a></div>
280 <hr />
281 <hr />
282 <a NAME="isNameConstant" ID="isNameConstant"></a>
283 <h2>isNameConstant</h2>
284 <b>isNameConstant</b>(<i>node</i>)
285
286 <p>
287 Function to check that a node is a name constant.
288 </p>
289 <dl>
290
291 <dt><i>node</i> (ast.AST)</dt>
292 <dd>
293 reference to the node to check
294 </dd>
295 </dl>
296 <dl>
297 <dt>Return:</dt>
298 <dd>
299 flag indicating a name constant
300 </dd>
301 </dl>
302 <dl>
303 <dt>Return Type:</dt>
304 <dd>
305 bool
306 </dd>
307 </dl>
308 <div align="right"><a href="#top">Up</a></div>
309 <hr />
310 <hr />
311 <a NAME="isNameConstant_1" ID="isNameConstant_1"></a>
312 <h2>isNameConstant</h2>
313 <b>isNameConstant</b>(<i>node</i>)
314
315 <p>
316 Function to check that a node is a name constant.
317 </p>
318 <dl>
319
320 <dt><i>node</i> (ast.AST)</dt>
321 <dd>
322 reference to the node to check
323 </dd>
324 </dl>
325 <dl>
326 <dt>Return:</dt>
327 <dd>
328 flag indicating a name constant
329 </dd>
330 </dl>
331 <dl>
332 <dt>Return Type:</dt>
333 <dd>
334 bool
335 </dd>
336 </dl>
337 <div align="right"><a href="#top">Up</a></div>
338 <hr />
339 <hr />
340 <a NAME="isNumber" ID="isNumber"></a>
341 <h2>isNumber</h2>
342 <b>isNumber</b>(<i>node</i>)
343
344 <p>
345 Function to check that a node is a number.
346 </p>
347 <dl>
348
349 <dt><i>node</i> (ast.AST)</dt>
350 <dd>
351 reference to the node to check
352 </dd>
353 </dl>
354 <dl>
355 <dt>Return:</dt>
356 <dd>
357 flag indicating a number
358 </dd>
359 </dl>
360 <dl>
361 <dt>Return Type:</dt>
362 <dd>
363 bool
364 </dd>
365 </dl>
366 <div align="right"><a href="#top">Up</a></div>
367 <hr />
368 <hr />
369 <a NAME="isNumber_1" ID="isNumber_1"></a>
370 <h2>isNumber</h2>
371 <b>isNumber</b>(<i>node</i>)
372
373 <p>
374 Function to check that a node is a number.
375 </p>
376 <dl>
377
378 <dt><i>node</i> (ast.AST)</dt>
379 <dd>
380 reference to the node to check
381 </dd>
382 </dl>
383 <dl>
384 <dt>Return:</dt>
385 <dd>
386 flag indicating a number
387 </dd>
388 </dl>
389 <dl>
390 <dt>Return Type:</dt>
391 <dd>
392 bool
393 </dd>
394 </dl>
395 <div align="right"><a href="#top">Up</a></div>
396 <hr />
397 <hr />
398 <a NAME="isString" ID="isString"></a>
399 <h2>isString</h2>
400 <b>isString</b>(<i>node</i>)
401
402 <p>
403 Function to check that a node is a string.
404 </p>
405 <dl>
406
407 <dt><i>node</i> (ast.AST)</dt>
408 <dd>
409 reference to the node to check
410 </dd>
411 </dl>
412 <dl>
413 <dt>Return:</dt>
414 <dd>
415 flag indicating a string
416 </dd>
417 </dl>
418 <dl>
419 <dt>Return Type:</dt>
420 <dd>
421 bool
422 </dd>
423 </dl>
424 <div align="right"><a href="#top">Up</a></div>
425 <hr />
426 <hr />
427 <a NAME="isString_1" ID="isString_1"></a>
428 <h2>isString</h2>
429 <b>isString</b>(<i>node</i>)
430
431 <p>
432 Function to check that a node is a string.
433 </p>
434 <dl>
435
436 <dt><i>node</i> (ast.AST)</dt>
437 <dd>
438 reference to the node to check
439 </dd>
440 </dl>
441 <dl>
442 <dt>Return:</dt>
443 <dd>
444 flag indicating a string
445 </dd>
446 </dl>
447 <dl>
448 <dt>Return Type:</dt>
449 <dd>
450 bool
451 </dd>
452 </dl>
453 <div align="right"><a href="#top">Up</a></div>
454 <hr />
455 </body></html>

eric ide

mercurial