|
1 <!DOCTYPE html> |
|
2 <html><head> |
|
3 <title>eric7.VCS.StatusMonitorThread</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.VCS.StatusMonitorThread</h1> |
|
24 |
|
25 <p> |
|
26 Module implementing the VCS status monitor thread base class. |
|
27 </p> |
|
28 <h3>Global Attributes</h3> |
|
29 |
|
30 <table> |
|
31 <tr><td>None</td></tr> |
|
32 </table> |
|
33 <h3>Classes</h3> |
|
34 |
|
35 <table> |
|
36 |
|
37 <tr> |
|
38 <td><a href="#VcsStatusMonitorThread">VcsStatusMonitorThread</a></td> |
|
39 <td>Class implementing the VCS status monitor thread base class.</td> |
|
40 </tr> |
|
41 </table> |
|
42 <h3>Functions</h3> |
|
43 |
|
44 <table> |
|
45 <tr><td>None</td></tr> |
|
46 </table> |
|
47 <hr /> |
|
48 <hr /> |
|
49 <a NAME="VcsStatusMonitorThread" ID="VcsStatusMonitorThread"></a> |
|
50 <h2>VcsStatusMonitorThread</h2> |
|
51 |
|
52 <p> |
|
53 Class implementing the VCS status monitor thread base class. |
|
54 </p> |
|
55 <h3>Signals</h3> |
|
56 <dl> |
|
57 |
|
58 <dt>vcsStatusMonitorData(list of str)</dt> |
|
59 <dd> |
|
60 emitted to update the VCS status |
|
61 </dd> |
|
62 <dt>vcsStatusMonitorInfo(str)</dt> |
|
63 <dd> |
|
64 emitted to signal some info of the |
|
65 monitoring thread |
|
66 </dd> |
|
67 <dt>vcsStatusMonitorStatus(str, str)</dt> |
|
68 <dd> |
|
69 emitted to signal the status of |
|
70 the monitoring thread (ok, nok, op) and a status message |
|
71 </dd> |
|
72 </dl> |
|
73 <h3>Derived from</h3> |
|
74 QThread |
|
75 <h3>Class Attributes</h3> |
|
76 |
|
77 <table> |
|
78 <tr><td>None</td></tr> |
|
79 </table> |
|
80 <h3>Class Methods</h3> |
|
81 |
|
82 <table> |
|
83 <tr><td>None</td></tr> |
|
84 </table> |
|
85 <h3>Methods</h3> |
|
86 |
|
87 <table> |
|
88 |
|
89 <tr> |
|
90 <td><a href="#VcsStatusMonitorThread.__init__">VcsStatusMonitorThread</a></td> |
|
91 <td>Constructor</td> |
|
92 </tr> |
|
93 <tr> |
|
94 <td><a href="#VcsStatusMonitorThread._getInfo">_getInfo</a></td> |
|
95 <td>Protected method implementing the real info action.</td> |
|
96 </tr> |
|
97 <tr> |
|
98 <td><a href="#VcsStatusMonitorThread._performMonitor">_performMonitor</a></td> |
|
99 <td>Protected method implementing the real monitoring action.</td> |
|
100 </tr> |
|
101 <tr> |
|
102 <td><a href="#VcsStatusMonitorThread._shutdown">_shutdown</a></td> |
|
103 <td>Protected method performing shutdown actions.</td> |
|
104 </tr> |
|
105 <tr> |
|
106 <td><a href="#VcsStatusMonitorThread.checkStatus">checkStatus</a></td> |
|
107 <td>Public method to wake up the status monitor thread.</td> |
|
108 </tr> |
|
109 <tr> |
|
110 <td><a href="#VcsStatusMonitorThread.clearCachedState">clearCachedState</a></td> |
|
111 <td>Public method to clear the cached VCS state of a file/directory.</td> |
|
112 </tr> |
|
113 <tr> |
|
114 <td><a href="#VcsStatusMonitorThread.getAutoUpdate">getAutoUpdate</a></td> |
|
115 <td>Public method to retrieve the status of the auto update function.</td> |
|
116 </tr> |
|
117 <tr> |
|
118 <td><a href="#VcsStatusMonitorThread.getInterval">getInterval</a></td> |
|
119 <td>Public method to get the monitor interval.</td> |
|
120 </tr> |
|
121 <tr> |
|
122 <td><a href="#VcsStatusMonitorThread.run">run</a></td> |
|
123 <td>Public method implementing the tasks action.</td> |
|
124 </tr> |
|
125 <tr> |
|
126 <td><a href="#VcsStatusMonitorThread.setAutoUpdate">setAutoUpdate</a></td> |
|
127 <td>Public method to enable the auto update function.</td> |
|
128 </tr> |
|
129 <tr> |
|
130 <td><a href="#VcsStatusMonitorThread.setInterval">setInterval</a></td> |
|
131 <td>Public method to change the monitor interval.</td> |
|
132 </tr> |
|
133 <tr> |
|
134 <td><a href="#VcsStatusMonitorThread.stop">stop</a></td> |
|
135 <td>Public method to stop the monitor thread.</td> |
|
136 </tr> |
|
137 </table> |
|
138 <h3>Static Methods</h3> |
|
139 |
|
140 <table> |
|
141 <tr><td>None</td></tr> |
|
142 </table> |
|
143 |
|
144 <a NAME="VcsStatusMonitorThread.__init__" ID="VcsStatusMonitorThread.__init__"></a> |
|
145 <h4>VcsStatusMonitorThread (Constructor)</h4> |
|
146 <b>VcsStatusMonitorThread</b>(<i>interval, project, vcs, parent=None</i>) |
|
147 |
|
148 <p> |
|
149 Constructor |
|
150 </p> |
|
151 <dl> |
|
152 |
|
153 <dt><i>interval</i></dt> |
|
154 <dd> |
|
155 new interval in seconds (integer) |
|
156 </dd> |
|
157 <dt><i>project</i></dt> |
|
158 <dd> |
|
159 reference to the project object (Project) |
|
160 </dd> |
|
161 <dt><i>vcs</i></dt> |
|
162 <dd> |
|
163 reference to the version control object |
|
164 </dd> |
|
165 <dt><i>parent</i></dt> |
|
166 <dd> |
|
167 reference to the parent object (QObject) |
|
168 </dd> |
|
169 </dl> |
|
170 <a NAME="VcsStatusMonitorThread._getInfo" ID="VcsStatusMonitorThread._getInfo"></a> |
|
171 <h4>VcsStatusMonitorThread._getInfo</h4> |
|
172 <b>_getInfo</b>(<i></i>) |
|
173 |
|
174 <p> |
|
175 Protected method implementing the real info action. |
|
176 </p> |
|
177 <p> |
|
178 This method should be overridden and create a short info message to be |
|
179 shown in the main window status bar right next to the status indicator. |
|
180 </p> |
|
181 <dl> |
|
182 <dt>Return:</dt> |
|
183 <dd> |
|
184 short info message |
|
185 </dd> |
|
186 </dl> |
|
187 <dl> |
|
188 <dt>Return Type:</dt> |
|
189 <dd> |
|
190 str |
|
191 </dd> |
|
192 </dl> |
|
193 <a NAME="VcsStatusMonitorThread._performMonitor" ID="VcsStatusMonitorThread._performMonitor"></a> |
|
194 <h4>VcsStatusMonitorThread._performMonitor</h4> |
|
195 <b>_performMonitor</b>(<i></i>) |
|
196 |
|
197 <p> |
|
198 Protected method implementing the real monitoring action. |
|
199 </p> |
|
200 <p> |
|
201 This method must be overridden and populate the statusList member |
|
202 variable with a list of strings giving the status in the first column |
|
203 and the path relative to the project directory starting with the |
|
204 third column. The allowed status flags are: |
|
205 <ul> |
|
206 <li>"A" path was added but not yet comitted</li> |
|
207 <li>"M" path has local changes</li> |
|
208 <li>"O" path was removed</li> |
|
209 <li>"R" path was deleted and then re-added</li> |
|
210 <li>"U" path needs an update</li> |
|
211 <li>"Z" path contains a conflict</li> |
|
212 <li>" " path is back at normal</li> |
|
213 </ul> |
|
214 </p> |
|
215 <dl> |
|
216 <dt>Return:</dt> |
|
217 <dd> |
|
218 tuple of flag indicating successful operation (boolean) and |
|
219 a status message in case of non successful operation (string) |
|
220 </dd> |
|
221 </dl> |
|
222 <dl> |
|
223 |
|
224 <dt>Raises <b>RuntimeError</b>:</dt> |
|
225 <dd> |
|
226 to indicate that this method must be |
|
227 implemented by a subclass |
|
228 </dd> |
|
229 </dl> |
|
230 <a NAME="VcsStatusMonitorThread._shutdown" ID="VcsStatusMonitorThread._shutdown"></a> |
|
231 <h4>VcsStatusMonitorThread._shutdown</h4> |
|
232 <b>_shutdown</b>(<i></i>) |
|
233 |
|
234 <p> |
|
235 Protected method performing shutdown actions. |
|
236 </p> |
|
237 <p> |
|
238 The default implementation does nothing. |
|
239 </p> |
|
240 <a NAME="VcsStatusMonitorThread.checkStatus" ID="VcsStatusMonitorThread.checkStatus"></a> |
|
241 <h4>VcsStatusMonitorThread.checkStatus</h4> |
|
242 <b>checkStatus</b>(<i></i>) |
|
243 |
|
244 <p> |
|
245 Public method to wake up the status monitor thread. |
|
246 </p> |
|
247 <a NAME="VcsStatusMonitorThread.clearCachedState" ID="VcsStatusMonitorThread.clearCachedState"></a> |
|
248 <h4>VcsStatusMonitorThread.clearCachedState</h4> |
|
249 <b>clearCachedState</b>(<i>name</i>) |
|
250 |
|
251 <p> |
|
252 Public method to clear the cached VCS state of a file/directory. |
|
253 </p> |
|
254 <dl> |
|
255 |
|
256 <dt><i>name</i></dt> |
|
257 <dd> |
|
258 name of the entry to be cleared (string) |
|
259 </dd> |
|
260 </dl> |
|
261 <a NAME="VcsStatusMonitorThread.getAutoUpdate" ID="VcsStatusMonitorThread.getAutoUpdate"></a> |
|
262 <h4>VcsStatusMonitorThread.getAutoUpdate</h4> |
|
263 <b>getAutoUpdate</b>(<i></i>) |
|
264 |
|
265 <p> |
|
266 Public method to retrieve the status of the auto update function. |
|
267 </p> |
|
268 <dl> |
|
269 <dt>Return:</dt> |
|
270 <dd> |
|
271 status of the auto update function (boolean) |
|
272 </dd> |
|
273 </dl> |
|
274 <a NAME="VcsStatusMonitorThread.getInterval" ID="VcsStatusMonitorThread.getInterval"></a> |
|
275 <h4>VcsStatusMonitorThread.getInterval</h4> |
|
276 <b>getInterval</b>(<i></i>) |
|
277 |
|
278 <p> |
|
279 Public method to get the monitor interval. |
|
280 </p> |
|
281 <dl> |
|
282 <dt>Return:</dt> |
|
283 <dd> |
|
284 interval in seconds (integer) |
|
285 </dd> |
|
286 </dl> |
|
287 <a NAME="VcsStatusMonitorThread.run" ID="VcsStatusMonitorThread.run"></a> |
|
288 <h4>VcsStatusMonitorThread.run</h4> |
|
289 <b>run</b>(<i></i>) |
|
290 |
|
291 <p> |
|
292 Public method implementing the tasks action. |
|
293 </p> |
|
294 <a NAME="VcsStatusMonitorThread.setAutoUpdate" ID="VcsStatusMonitorThread.setAutoUpdate"></a> |
|
295 <h4>VcsStatusMonitorThread.setAutoUpdate</h4> |
|
296 <b>setAutoUpdate</b>(<i>auto</i>) |
|
297 |
|
298 <p> |
|
299 Public method to enable the auto update function. |
|
300 </p> |
|
301 <dl> |
|
302 |
|
303 <dt><i>auto</i></dt> |
|
304 <dd> |
|
305 status of the auto update function (boolean) |
|
306 </dd> |
|
307 </dl> |
|
308 <a NAME="VcsStatusMonitorThread.setInterval" ID="VcsStatusMonitorThread.setInterval"></a> |
|
309 <h4>VcsStatusMonitorThread.setInterval</h4> |
|
310 <b>setInterval</b>(<i>interval</i>) |
|
311 |
|
312 <p> |
|
313 Public method to change the monitor interval. |
|
314 </p> |
|
315 <dl> |
|
316 |
|
317 <dt><i>interval</i></dt> |
|
318 <dd> |
|
319 new interval in seconds (integer) |
|
320 </dd> |
|
321 </dl> |
|
322 <a NAME="VcsStatusMonitorThread.stop" ID="VcsStatusMonitorThread.stop"></a> |
|
323 <h4>VcsStatusMonitorThread.stop</h4> |
|
324 <b>stop</b>(<i></i>) |
|
325 |
|
326 <p> |
|
327 Public method to stop the monitor thread. |
|
328 </p> |
|
329 <div align="right"><a href="#top">Up</a></div> |
|
330 <hr /> |
|
331 </body></html> |