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