|
1 <!DOCTYPE html> |
|
2 <html><head> |
|
3 <title>eric7.EricWidgets.EricProcessDialog</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.EricWidgets.EricProcessDialog</h1> |
|
10 |
|
11 <p> |
|
12 Module implementing a dialog starting a process and showing its output. |
|
13 </p> |
|
14 <h3>Global Attributes</h3> |
|
15 |
|
16 <table> |
|
17 <tr><td>None</td></tr> |
|
18 </table> |
|
19 <h3>Classes</h3> |
|
20 |
|
21 <table> |
|
22 |
|
23 <tr> |
|
24 <td><a href="#EricProcessDialog">EricProcessDialog</a></td> |
|
25 <td>Class implementing a dialog starting a process and showing its output.</td> |
|
26 </tr> |
|
27 </table> |
|
28 <h3>Functions</h3> |
|
29 |
|
30 <table> |
|
31 <tr><td>None</td></tr> |
|
32 </table> |
|
33 <hr /> |
|
34 <hr /> |
|
35 <a NAME="EricProcessDialog" ID="EricProcessDialog"></a> |
|
36 <h2>EricProcessDialog</h2> |
|
37 |
|
38 <p> |
|
39 Class implementing a dialog starting a process and showing its output. |
|
40 </p> |
|
41 <p> |
|
42 It starts a QProcess and displays a dialog that shows the output of the |
|
43 process. The dialog is modal, which causes a synchronized execution of |
|
44 the process. |
|
45 </p> |
|
46 <h3>Derived from</h3> |
|
47 QDialog, Ui_EricProcessDialog |
|
48 <h3>Class Attributes</h3> |
|
49 |
|
50 <table> |
|
51 <tr><td>None</td></tr> |
|
52 </table> |
|
53 <h3>Class Methods</h3> |
|
54 |
|
55 <table> |
|
56 <tr><td>None</td></tr> |
|
57 </table> |
|
58 <h3>Methods</h3> |
|
59 |
|
60 <table> |
|
61 |
|
62 <tr> |
|
63 <td><a href="#EricProcessDialog.__init__">EricProcessDialog</a></td> |
|
64 <td>Constructor</td> |
|
65 </tr> |
|
66 <tr> |
|
67 <td><a href="#EricProcessDialog.__finish">__finish</a></td> |
|
68 <td>Private slot called when the process finished or the user pressed the button.</td> |
|
69 </tr> |
|
70 <tr> |
|
71 <td><a href="#EricProcessDialog.__procFinished">__procFinished</a></td> |
|
72 <td>Private slot connected to the finished signal.</td> |
|
73 </tr> |
|
74 <tr> |
|
75 <td><a href="#EricProcessDialog.__readStderr">__readStderr</a></td> |
|
76 <td>Private slot to handle the readyReadStandardError signal.</td> |
|
77 </tr> |
|
78 <tr> |
|
79 <td><a href="#EricProcessDialog.__readStdout">__readStdout</a></td> |
|
80 <td>Private slot to handle the readyReadStandardOutput signal.</td> |
|
81 </tr> |
|
82 <tr> |
|
83 <td><a href="#EricProcessDialog.keyPressEvent">keyPressEvent</a></td> |
|
84 <td>Protected slot to handle a key press event.</td> |
|
85 </tr> |
|
86 <tr> |
|
87 <td><a href="#EricProcessDialog.normalExit">normalExit</a></td> |
|
88 <td>Public method to check for a normal process termination.</td> |
|
89 </tr> |
|
90 <tr> |
|
91 <td><a href="#EricProcessDialog.normalExitWithoutErrors">normalExitWithoutErrors</a></td> |
|
92 <td>Public method to check for a normal process termination without error messages.</td> |
|
93 </tr> |
|
94 <tr> |
|
95 <td><a href="#EricProcessDialog.on_buttonBox_clicked">on_buttonBox_clicked</a></td> |
|
96 <td>Private slot called by a button of the button box clicked.</td> |
|
97 </tr> |
|
98 <tr> |
|
99 <td><a href="#EricProcessDialog.on_input_returnPressed">on_input_returnPressed</a></td> |
|
100 <td>Private slot to handle the press of the return key in the input field.</td> |
|
101 </tr> |
|
102 <tr> |
|
103 <td><a href="#EricProcessDialog.on_passwordCheckBox_toggled">on_passwordCheckBox_toggled</a></td> |
|
104 <td>Private slot to handle the password checkbox toggled.</td> |
|
105 </tr> |
|
106 <tr> |
|
107 <td><a href="#EricProcessDialog.on_sendButton_clicked">on_sendButton_clicked</a></td> |
|
108 <td>Private slot to send the input to the git process.</td> |
|
109 </tr> |
|
110 <tr> |
|
111 <td><a href="#EricProcessDialog.startProcess">startProcess</a></td> |
|
112 <td>Public slot used to start the process.</td> |
|
113 </tr> |
|
114 </table> |
|
115 <h3>Static Methods</h3> |
|
116 |
|
117 <table> |
|
118 <tr><td>None</td></tr> |
|
119 </table> |
|
120 |
|
121 <a NAME="EricProcessDialog.__init__" ID="EricProcessDialog.__init__"></a> |
|
122 <h4>EricProcessDialog (Constructor)</h4> |
|
123 <b>EricProcessDialog</b>(<i>outputTitle="", windowTitle="", showProgress=False, parent=None</i>) |
|
124 |
|
125 <p> |
|
126 Constructor |
|
127 </p> |
|
128 <dl> |
|
129 |
|
130 <dt><i>outputTitle</i> (str)</dt> |
|
131 <dd> |
|
132 title for the output group |
|
133 </dd> |
|
134 <dt><i>windowTitle</i> (str)</dt> |
|
135 <dd> |
|
136 title of the dialog |
|
137 </dd> |
|
138 <dt><i>showProgress</i> (bool)</dt> |
|
139 <dd> |
|
140 flag indicating to show a progress bar |
|
141 </dd> |
|
142 <dt><i>parent</i> (QWidget)</dt> |
|
143 <dd> |
|
144 reference to the parent widget |
|
145 </dd> |
|
146 </dl> |
|
147 <a NAME="EricProcessDialog.__finish" ID="EricProcessDialog.__finish"></a> |
|
148 <h4>EricProcessDialog.__finish</h4> |
|
149 <b>__finish</b>(<i></i>) |
|
150 |
|
151 <p> |
|
152 Private slot called when the process finished or the user pressed |
|
153 the button. |
|
154 </p> |
|
155 <a NAME="EricProcessDialog.__procFinished" ID="EricProcessDialog.__procFinished"></a> |
|
156 <h4>EricProcessDialog.__procFinished</h4> |
|
157 <b>__procFinished</b>(<i>exitCode, exitStatus</i>) |
|
158 |
|
159 <p> |
|
160 Private slot connected to the finished signal. |
|
161 </p> |
|
162 <dl> |
|
163 |
|
164 <dt><i>exitCode</i> (int)</dt> |
|
165 <dd> |
|
166 exit code of the process |
|
167 </dd> |
|
168 <dt><i>exitStatus</i> (QProcess.ExitStatus)</dt> |
|
169 <dd> |
|
170 exit status of the process |
|
171 </dd> |
|
172 </dl> |
|
173 <a NAME="EricProcessDialog.__readStderr" ID="EricProcessDialog.__readStderr"></a> |
|
174 <h4>EricProcessDialog.__readStderr</h4> |
|
175 <b>__readStderr</b>(<i></i>) |
|
176 |
|
177 <p> |
|
178 Private slot to handle the readyReadStandardError signal. |
|
179 </p> |
|
180 <p> |
|
181 It reads the error output of the process and inserts it into the |
|
182 error pane. |
|
183 </p> |
|
184 <a NAME="EricProcessDialog.__readStdout" ID="EricProcessDialog.__readStdout"></a> |
|
185 <h4>EricProcessDialog.__readStdout</h4> |
|
186 <b>__readStdout</b>(<i></i>) |
|
187 |
|
188 <p> |
|
189 Private slot to handle the readyReadStandardOutput signal. |
|
190 </p> |
|
191 <p> |
|
192 It reads the output of the process and inserts it into the |
|
193 output pane. |
|
194 </p> |
|
195 <a NAME="EricProcessDialog.keyPressEvent" ID="EricProcessDialog.keyPressEvent"></a> |
|
196 <h4>EricProcessDialog.keyPressEvent</h4> |
|
197 <b>keyPressEvent</b>(<i>evt</i>) |
|
198 |
|
199 <p> |
|
200 Protected slot to handle a key press event. |
|
201 </p> |
|
202 <dl> |
|
203 |
|
204 <dt><i>evt</i></dt> |
|
205 <dd> |
|
206 the key press event (QKeyEvent) |
|
207 </dd> |
|
208 </dl> |
|
209 <a NAME="EricProcessDialog.normalExit" ID="EricProcessDialog.normalExit"></a> |
|
210 <h4>EricProcessDialog.normalExit</h4> |
|
211 <b>normalExit</b>(<i></i>) |
|
212 |
|
213 <p> |
|
214 Public method to check for a normal process termination. |
|
215 </p> |
|
216 <dl> |
|
217 <dt>Return:</dt> |
|
218 <dd> |
|
219 flag indicating normal process termination |
|
220 </dd> |
|
221 </dl> |
|
222 <dl> |
|
223 <dt>Return Type:</dt> |
|
224 <dd> |
|
225 bool |
|
226 </dd> |
|
227 </dl> |
|
228 <a NAME="EricProcessDialog.normalExitWithoutErrors" ID="EricProcessDialog.normalExitWithoutErrors"></a> |
|
229 <h4>EricProcessDialog.normalExitWithoutErrors</h4> |
|
230 <b>normalExitWithoutErrors</b>(<i></i>) |
|
231 |
|
232 <p> |
|
233 Public method to check for a normal process termination without |
|
234 error messages. |
|
235 </p> |
|
236 <dl> |
|
237 <dt>Return:</dt> |
|
238 <dd> |
|
239 flag indicating normal process termination |
|
240 </dd> |
|
241 </dl> |
|
242 <dl> |
|
243 <dt>Return Type:</dt> |
|
244 <dd> |
|
245 bool |
|
246 </dd> |
|
247 </dl> |
|
248 <a NAME="EricProcessDialog.on_buttonBox_clicked" ID="EricProcessDialog.on_buttonBox_clicked"></a> |
|
249 <h4>EricProcessDialog.on_buttonBox_clicked</h4> |
|
250 <b>on_buttonBox_clicked</b>(<i>button</i>) |
|
251 |
|
252 <p> |
|
253 Private slot called by a button of the button box clicked. |
|
254 </p> |
|
255 <dl> |
|
256 |
|
257 <dt><i>button</i> (QAbstractButton)</dt> |
|
258 <dd> |
|
259 button that was clicked |
|
260 </dd> |
|
261 </dl> |
|
262 <a NAME="EricProcessDialog.on_input_returnPressed" ID="EricProcessDialog.on_input_returnPressed"></a> |
|
263 <h4>EricProcessDialog.on_input_returnPressed</h4> |
|
264 <b>on_input_returnPressed</b>(<i></i>) |
|
265 |
|
266 <p> |
|
267 Private slot to handle the press of the return key in the input field. |
|
268 </p> |
|
269 <a NAME="EricProcessDialog.on_passwordCheckBox_toggled" ID="EricProcessDialog.on_passwordCheckBox_toggled"></a> |
|
270 <h4>EricProcessDialog.on_passwordCheckBox_toggled</h4> |
|
271 <b>on_passwordCheckBox_toggled</b>(<i>isOn</i>) |
|
272 |
|
273 <p> |
|
274 Private slot to handle the password checkbox toggled. |
|
275 </p> |
|
276 <dl> |
|
277 |
|
278 <dt><i>isOn</i> (bool)</dt> |
|
279 <dd> |
|
280 flag indicating the status of the check box |
|
281 </dd> |
|
282 </dl> |
|
283 <a NAME="EricProcessDialog.on_sendButton_clicked" ID="EricProcessDialog.on_sendButton_clicked"></a> |
|
284 <h4>EricProcessDialog.on_sendButton_clicked</h4> |
|
285 <b>on_sendButton_clicked</b>(<i></i>) |
|
286 |
|
287 <p> |
|
288 Private slot to send the input to the git process. |
|
289 </p> |
|
290 <a NAME="EricProcessDialog.startProcess" ID="EricProcessDialog.startProcess"></a> |
|
291 <h4>EricProcessDialog.startProcess</h4> |
|
292 <b>startProcess</b>(<i>program, args, workingDir=None, showArgs=True, environment=None</i>) |
|
293 |
|
294 <p> |
|
295 Public slot used to start the process. |
|
296 </p> |
|
297 <dl> |
|
298 |
|
299 <dt><i>program</i> (str)</dt> |
|
300 <dd> |
|
301 path of the program to be executed |
|
302 </dd> |
|
303 <dt><i>args</i> (list of str)</dt> |
|
304 <dd> |
|
305 list of arguments for the process |
|
306 </dd> |
|
307 <dt><i>workingDir</i> (str)</dt> |
|
308 <dd> |
|
309 working directory for the process |
|
310 </dd> |
|
311 <dt><i>showArgs</i> (bool)</dt> |
|
312 <dd> |
|
313 flag indicating to show the arguments |
|
314 </dd> |
|
315 <dt><i>environment</i> (dict)</dt> |
|
316 <dd> |
|
317 dictionary of environment settings to add |
|
318 or change for the process |
|
319 </dd> |
|
320 </dl> |
|
321 <dl> |
|
322 <dt>Return:</dt> |
|
323 <dd> |
|
324 flag indicating a successful start of the process |
|
325 </dd> |
|
326 </dl> |
|
327 <dl> |
|
328 <dt>Return Type:</dt> |
|
329 <dd> |
|
330 bool |
|
331 </dd> |
|
332 </dl> |
|
333 <div align="right"><a href="#top">Up</a></div> |
|
334 <hr /> |
|
335 </body></html> |