|
1 <!DOCTYPE html> |
|
2 <html><head> |
|
3 <title>eric7.MicroPython.MicroPythonReplWidget</title> |
|
4 <meta charset="UTF-8"> |
|
5 <link rel="stylesheet" href="styles.css"> |
|
6 </head> |
|
7 <body> |
|
8 <a NAME="top" ID="top"></a> |
|
9 <h1>eric7.MicroPython.MicroPythonReplWidget</h1> |
|
10 |
|
11 <p> |
|
12 Module implementing the MicroPython REPL widget. |
|
13 </p> |
|
14 <h3>Global Attributes</h3> |
|
15 |
|
16 <table> |
|
17 <tr><td>AnsiColorSchemes</td></tr> |
|
18 </table> |
|
19 <h3>Classes</h3> |
|
20 |
|
21 <table> |
|
22 |
|
23 <tr> |
|
24 <td><a href="#MicroPythonReplEdit">MicroPythonReplEdit</a></td> |
|
25 <td>Class implementing the REPL edit pane.</td> |
|
26 </tr> |
|
27 <tr> |
|
28 <td><a href="#MicroPythonReplWidget">MicroPythonReplWidget</a></td> |
|
29 <td>Class implementing the MicroPython REPL widget.</td> |
|
30 </tr> |
|
31 </table> |
|
32 <h3>Functions</h3> |
|
33 |
|
34 <table> |
|
35 <tr><td>None</td></tr> |
|
36 </table> |
|
37 <hr /> |
|
38 <hr /> |
|
39 <a NAME="MicroPythonReplEdit" ID="MicroPythonReplEdit"></a> |
|
40 <h2>MicroPythonReplEdit</h2> |
|
41 |
|
42 <p> |
|
43 Class implementing the REPL edit pane. |
|
44 </p> |
|
45 <h3>Signals</h3> |
|
46 <dl> |
|
47 |
|
48 <dt>osdInfo(str)</dt> |
|
49 <dd> |
|
50 emitted when some OSD data was received from the device |
|
51 </dd> |
|
52 </dl> |
|
53 <h3>Derived from</h3> |
|
54 QTextEdit |
|
55 <h3>Class Attributes</h3> |
|
56 |
|
57 <table> |
|
58 <tr><td>None</td></tr> |
|
59 </table> |
|
60 <h3>Class Methods</h3> |
|
61 |
|
62 <table> |
|
63 <tr><td>None</td></tr> |
|
64 </table> |
|
65 <h3>Methods</h3> |
|
66 |
|
67 <table> |
|
68 |
|
69 <tr> |
|
70 <td><a href="#MicroPythonReplEdit.__init__">MicroPythonReplEdit</a></td> |
|
71 <td>Constructor</td> |
|
72 </tr> |
|
73 <tr> |
|
74 <td><a href="#MicroPythonReplEdit.__clear">__clear</a></td> |
|
75 <td>Private slot to clear the REPL pane.</td> |
|
76 </tr> |
|
77 <tr> |
|
78 <td><a href="#MicroPythonReplEdit.__paste">__paste</a></td> |
|
79 <td>Private slot to perform a paste operation.</td> |
|
80 </tr> |
|
81 <tr> |
|
82 <td><a href="#MicroPythonReplEdit.__setCharFormat">__setCharFormat</a></td> |
|
83 <td>Private method setting the current text format of the REPL pane based on the passed ANSI codes.</td> |
|
84 </tr> |
|
85 <tr> |
|
86 <td><a href="#MicroPythonReplEdit.__showContextMenu">__showContextMenu</a></td> |
|
87 <td>Private slot to show the REPL context menu.</td> |
|
88 </tr> |
|
89 <tr> |
|
90 <td><a href="#MicroPythonReplEdit.doZoom">doZoom</a></td> |
|
91 <td>Public slot to zoom in or out.</td> |
|
92 </tr> |
|
93 <tr> |
|
94 <td><a href="#MicroPythonReplEdit.handlePreferencesChanged">handlePreferencesChanged</a></td> |
|
95 <td>Public slot to handle a change in preferences.</td> |
|
96 </tr> |
|
97 <tr> |
|
98 <td><a href="#MicroPythonReplEdit.keyPressEvent">keyPressEvent</a></td> |
|
99 <td>Protected method to handle key press events.</td> |
|
100 </tr> |
|
101 <tr> |
|
102 <td><a href="#MicroPythonReplEdit.mouseReleaseEvent">mouseReleaseEvent</a></td> |
|
103 <td>Protected method to handle mouse release events.</td> |
|
104 </tr> |
|
105 <tr> |
|
106 <td><a href="#MicroPythonReplEdit.processData">processData</a></td> |
|
107 <td>Public slot to process the data received from the device.</td> |
|
108 </tr> |
|
109 <tr> |
|
110 <td><a href="#MicroPythonReplEdit.setInterface">setInterface</a></td> |
|
111 <td>Public method to set the reference to the device interface object.</td> |
|
112 </tr> |
|
113 </table> |
|
114 <h3>Static Methods</h3> |
|
115 |
|
116 <table> |
|
117 <tr><td>None</td></tr> |
|
118 </table> |
|
119 |
|
120 <a NAME="MicroPythonReplEdit.__init__" ID="MicroPythonReplEdit.__init__"></a> |
|
121 <h4>MicroPythonReplEdit (Constructor)</h4> |
|
122 <b>MicroPythonReplEdit</b>(<i>parent=None</i>) |
|
123 |
|
124 <p> |
|
125 Constructor |
|
126 </p> |
|
127 <dl> |
|
128 |
|
129 <dt><i>parent</i> (QWidget (optional))</dt> |
|
130 <dd> |
|
131 reference to the parent widget (defaults to None) |
|
132 </dd> |
|
133 </dl> |
|
134 <a NAME="MicroPythonReplEdit.__clear" ID="MicroPythonReplEdit.__clear"></a> |
|
135 <h4>MicroPythonReplEdit.__clear</h4> |
|
136 <b>__clear</b>(<i></i>) |
|
137 |
|
138 <p> |
|
139 Private slot to clear the REPL pane. |
|
140 </p> |
|
141 <a NAME="MicroPythonReplEdit.__paste" ID="MicroPythonReplEdit.__paste"></a> |
|
142 <h4>MicroPythonReplEdit.__paste</h4> |
|
143 <b>__paste</b>(<i>mode=QClipboard.Mode.Clipboard</i>) |
|
144 |
|
145 <p> |
|
146 Private slot to perform a paste operation. |
|
147 </p> |
|
148 <dl> |
|
149 |
|
150 <dt><i>mode</i> (QClipboard.Mode (optional))</dt> |
|
151 <dd> |
|
152 paste mode (defaults to QClipboard.Mode.Clipboard) |
|
153 </dd> |
|
154 </dl> |
|
155 <a NAME="MicroPythonReplEdit.__setCharFormat" ID="MicroPythonReplEdit.__setCharFormat"></a> |
|
156 <h4>MicroPythonReplEdit.__setCharFormat</h4> |
|
157 <b>__setCharFormat</b>(<i>formatCodes, textCursor</i>) |
|
158 |
|
159 <p> |
|
160 Private method setting the current text format of the REPL pane based |
|
161 on the passed ANSI codes. |
|
162 </p> |
|
163 <p> |
|
164 Following codes are used: |
|
165 <ul> |
|
166 <li>0: Reset</li> |
|
167 <li>1: Bold font (weight 75)</li> |
|
168 <li>2: Light font (weight 25)</li> |
|
169 <li>3: Italic font</li> |
|
170 <li>4: Underlined font</li> |
|
171 <li>9: Strikeout font</li> |
|
172 <li>21: Bold off (weight 50)</li> |
|
173 <li>22: Light off (weight 50)</li> |
|
174 <li>23: Italic off</li> |
|
175 <li>24: Underline off</li> |
|
176 <li>29: Strikeout off</li> |
|
177 <li>30: foreground Black</li> |
|
178 <li>31: foreground Dark Red</li> |
|
179 <li>32: foreground Dark Green</li> |
|
180 <li>33: foreground Dark Yellow</li> |
|
181 <li>34: foreground Dark Blue</li> |
|
182 <li>35: foreground Dark Magenta</li> |
|
183 <li>36: foreground Dark Cyan</li> |
|
184 <li>37: foreground Light Gray</li> |
|
185 <li>39: reset foreground to default</li> |
|
186 <li>40: background Black</li> |
|
187 <li>41: background Dark Red</li> |
|
188 <li>42: background Dark Green</li> |
|
189 <li>43: background Dark Yellow</li> |
|
190 <li>44: background Dark Blue</li> |
|
191 <li>45: background Dark Magenta</li> |
|
192 <li>46: background Dark Cyan</li> |
|
193 <li>47: background Light Gray</li> |
|
194 <li>49: reset background to default</li> |
|
195 <li>53: Overlined font</li> |
|
196 <li>55: Overline off</li> |
|
197 <li>90: bright foreground Dark Gray</li> |
|
198 <li>91: bright foreground Red</li> |
|
199 <li>92: bright foreground Green</li> |
|
200 <li>93: bright foreground Yellow</li> |
|
201 <li>94: bright foreground Blue</li> |
|
202 <li>95: bright foreground Magenta</li> |
|
203 <li>96: bright foreground Cyan</li> |
|
204 <li>97: bright foreground White</li> |
|
205 <li>100: bright background Dark Gray</li> |
|
206 <li>101: bright background Red</li> |
|
207 <li>102: bright background Green</li> |
|
208 <li>103: bright background Yellow</li> |
|
209 <li>104: bright background Blue</li> |
|
210 <li>105: bright background Magenta</li> |
|
211 <li>106: bright background Cyan</li> |
|
212 <li>107: bright background White</li> |
|
213 </ul> |
|
214 </p> |
|
215 <dl> |
|
216 |
|
217 <dt><i>formatCodes</i> (list of str)</dt> |
|
218 <dd> |
|
219 list of format codes |
|
220 </dd> |
|
221 <dt><i>textCursor</i> (QTextCursor)</dt> |
|
222 <dd> |
|
223 reference to the text cursor |
|
224 </dd> |
|
225 </dl> |
|
226 <a NAME="MicroPythonReplEdit.__showContextMenu" ID="MicroPythonReplEdit.__showContextMenu"></a> |
|
227 <h4>MicroPythonReplEdit.__showContextMenu</h4> |
|
228 <b>__showContextMenu</b>(<i>pos</i>) |
|
229 |
|
230 <p> |
|
231 Private slot to show the REPL context menu. |
|
232 </p> |
|
233 <dl> |
|
234 |
|
235 <dt><i>pos</i> (QPoint)</dt> |
|
236 <dd> |
|
237 position to show the menu at |
|
238 </dd> |
|
239 </dl> |
|
240 <a NAME="MicroPythonReplEdit.doZoom" ID="MicroPythonReplEdit.doZoom"></a> |
|
241 <h4>MicroPythonReplEdit.doZoom</h4> |
|
242 <b>doZoom</b>(<i>value</i>) |
|
243 |
|
244 <p> |
|
245 Public slot to zoom in or out. |
|
246 </p> |
|
247 <dl> |
|
248 |
|
249 <dt><i>value</i> (int)</dt> |
|
250 <dd> |
|
251 zoom value |
|
252 </dd> |
|
253 </dl> |
|
254 <a NAME="MicroPythonReplEdit.handlePreferencesChanged" ID="MicroPythonReplEdit.handlePreferencesChanged"></a> |
|
255 <h4>MicroPythonReplEdit.handlePreferencesChanged</h4> |
|
256 <b>handlePreferencesChanged</b>(<i></i>) |
|
257 |
|
258 <p> |
|
259 Public slot to handle a change in preferences. |
|
260 </p> |
|
261 <a NAME="MicroPythonReplEdit.keyPressEvent" ID="MicroPythonReplEdit.keyPressEvent"></a> |
|
262 <h4>MicroPythonReplEdit.keyPressEvent</h4> |
|
263 <b>keyPressEvent</b>(<i>evt</i>) |
|
264 |
|
265 <p> |
|
266 Protected method to handle key press events. |
|
267 </p> |
|
268 <dl> |
|
269 |
|
270 <dt><i>evt</i> (QKeyEvent)</dt> |
|
271 <dd> |
|
272 reference to the key press event |
|
273 </dd> |
|
274 </dl> |
|
275 <a NAME="MicroPythonReplEdit.mouseReleaseEvent" ID="MicroPythonReplEdit.mouseReleaseEvent"></a> |
|
276 <h4>MicroPythonReplEdit.mouseReleaseEvent</h4> |
|
277 <b>mouseReleaseEvent</b>(<i>evt</i>) |
|
278 |
|
279 <p> |
|
280 Protected method to handle mouse release events. |
|
281 </p> |
|
282 <dl> |
|
283 |
|
284 <dt><i>evt</i> (QMouseEvent)</dt> |
|
285 <dd> |
|
286 reference to the event object |
|
287 </dd> |
|
288 </dl> |
|
289 <a NAME="MicroPythonReplEdit.processData" ID="MicroPythonReplEdit.processData"></a> |
|
290 <h4>MicroPythonReplEdit.processData</h4> |
|
291 <b>processData</b>(<i>data</i>) |
|
292 |
|
293 <p> |
|
294 Public slot to process the data received from the device. |
|
295 </p> |
|
296 <dl> |
|
297 |
|
298 <dt><i>data</i> (bytes)</dt> |
|
299 <dd> |
|
300 data received from the device |
|
301 </dd> |
|
302 </dl> |
|
303 <a NAME="MicroPythonReplEdit.setInterface" ID="MicroPythonReplEdit.setInterface"></a> |
|
304 <h4>MicroPythonReplEdit.setInterface</h4> |
|
305 <b>setInterface</b>(<i>deviceInterface</i>) |
|
306 |
|
307 <p> |
|
308 Public method to set the reference to the device interface object. |
|
309 </p> |
|
310 <dl> |
|
311 |
|
312 <dt><i>deviceInterface</i> (MicroPythonDeviceInterface)</dt> |
|
313 <dd> |
|
314 reference to the device interface object |
|
315 </dd> |
|
316 </dl> |
|
317 <div align="right"><a href="#top">Up</a></div> |
|
318 <hr /> |
|
319 <hr /> |
|
320 <a NAME="MicroPythonReplWidget" ID="MicroPythonReplWidget"></a> |
|
321 <h2>MicroPythonReplWidget</h2> |
|
322 |
|
323 <p> |
|
324 Class implementing the MicroPython REPL widget. |
|
325 </p> |
|
326 <h3>Derived from</h3> |
|
327 QWidget |
|
328 <h3>Class Attributes</h3> |
|
329 |
|
330 <table> |
|
331 <tr><td>ZoomMax</td></tr><tr><td>ZoomMin</td></tr> |
|
332 </table> |
|
333 <h3>Class Methods</h3> |
|
334 |
|
335 <table> |
|
336 <tr><td>None</td></tr> |
|
337 </table> |
|
338 <h3>Methods</h3> |
|
339 |
|
340 <table> |
|
341 |
|
342 <tr> |
|
343 <td><a href="#MicroPythonReplWidget.__init__">MicroPythonReplWidget</a></td> |
|
344 <td>Constructor</td> |
|
345 </tr> |
|
346 <tr> |
|
347 <td><a href="#MicroPythonReplWidget.clearOSD">clearOSD</a></td> |
|
348 <td>Public slot to clear the OSD info.</td> |
|
349 </tr> |
|
350 <tr> |
|
351 <td><a href="#MicroPythonReplWidget.replEdit">replEdit</a></td> |
|
352 <td>Public method to get a reference to the REPL edit.</td> |
|
353 </tr> |
|
354 <tr> |
|
355 <td><a href="#MicroPythonReplWidget.setOSDInfo">setOSDInfo</a></td> |
|
356 <td>Public slot to set the OSD information.</td> |
|
357 </tr> |
|
358 </table> |
|
359 <h3>Static Methods</h3> |
|
360 |
|
361 <table> |
|
362 <tr><td>None</td></tr> |
|
363 </table> |
|
364 |
|
365 <a NAME="MicroPythonReplWidget.__init__" ID="MicroPythonReplWidget.__init__"></a> |
|
366 <h4>MicroPythonReplWidget (Constructor)</h4> |
|
367 <b>MicroPythonReplWidget</b>(<i>parent=None</i>) |
|
368 |
|
369 <p> |
|
370 Constructor |
|
371 </p> |
|
372 <dl> |
|
373 |
|
374 <dt><i>parent</i> (QWidget (optional))</dt> |
|
375 <dd> |
|
376 reference to the parent widget (defaults to None) |
|
377 </dd> |
|
378 </dl> |
|
379 <a NAME="MicroPythonReplWidget.clearOSD" ID="MicroPythonReplWidget.clearOSD"></a> |
|
380 <h4>MicroPythonReplWidget.clearOSD</h4> |
|
381 <b>clearOSD</b>(<i></i>) |
|
382 |
|
383 <p> |
|
384 Public slot to clear the OSD info. |
|
385 </p> |
|
386 <a NAME="MicroPythonReplWidget.replEdit" ID="MicroPythonReplWidget.replEdit"></a> |
|
387 <h4>MicroPythonReplWidget.replEdit</h4> |
|
388 <b>replEdit</b>(<i></i>) |
|
389 |
|
390 <p> |
|
391 Public method to get a reference to the REPL edit. |
|
392 </p> |
|
393 <dl> |
|
394 <dt>Return:</dt> |
|
395 <dd> |
|
396 reference to the REPL edit |
|
397 </dd> |
|
398 </dl> |
|
399 <dl> |
|
400 <dt>Return Type:</dt> |
|
401 <dd> |
|
402 MicroPythonReplEdit |
|
403 </dd> |
|
404 </dl> |
|
405 <a NAME="MicroPythonReplWidget.setOSDInfo" ID="MicroPythonReplWidget.setOSDInfo"></a> |
|
406 <h4>MicroPythonReplWidget.setOSDInfo</h4> |
|
407 <b>setOSDInfo</b>(<i>infoStr</i>) |
|
408 |
|
409 <p> |
|
410 Public slot to set the OSD information. |
|
411 </p> |
|
412 <dl> |
|
413 |
|
414 <dt><i>infoStr</i> (str)</dt> |
|
415 <dd> |
|
416 string to be shown |
|
417 </dd> |
|
418 </dl> |
|
419 <div align="right"><a href="#top">Up</a></div> |
|
420 <hr /> |
|
421 </body></html> |