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