32 |
32 |
33 def __init__(self, interval, project, vcs, parent=None): |
33 def __init__(self, interval, project, vcs, parent=None): |
34 """ |
34 """ |
35 Constructor |
35 Constructor |
36 |
36 |
37 @param interval new interval in seconds (integer) |
37 @param interval new interval in seconds |
38 @param project reference to the project object (Project) |
38 @type int |
|
39 @param project reference to the project object |
|
40 @type Project |
39 @param vcs reference to the version control object |
41 @param vcs reference to the version control object |
40 @param parent reference to the parent object (QObject) |
42 @type VersionControl |
|
43 @param parent reference to the parent object |
|
44 @type QObject |
41 """ |
45 """ |
42 super().__init__(parent) |
46 super().__init__(parent) |
43 self.setObjectName("VcsStatusMonitorThread") |
47 self.setObjectName("VcsStatusMonitorThread") |
44 |
48 |
45 self.setTerminationEnabled(True) |
49 self.setTerminationEnabled(True) |
127 |
131 |
128 def setInterval(self, interval): |
132 def setInterval(self, interval): |
129 """ |
133 """ |
130 Public method to change the monitor interval. |
134 Public method to change the monitor interval. |
131 |
135 |
132 @param interval new interval in seconds (integer) |
136 @param interval new interval in seconds |
|
137 @type int |
133 """ |
138 """ |
134 locked = self.monitorMutex.tryLock() |
139 locked = self.monitorMutex.tryLock() |
135 self.interval = interval |
140 self.interval = interval |
136 self.monitorCondition.wakeAll() |
141 self.monitorCondition.wakeAll() |
137 if locked: |
142 if locked: |
139 |
144 |
140 def getInterval(self): |
145 def getInterval(self): |
141 """ |
146 """ |
142 Public method to get the monitor interval. |
147 Public method to get the monitor interval. |
143 |
148 |
144 @return interval in seconds (integer) |
149 @return interval in seconds |
|
150 @rtype int |
145 """ |
151 """ |
146 return self.interval |
152 return self.interval |
147 |
153 |
148 def setAutoUpdate(self, auto): |
154 def setAutoUpdate(self, auto): |
149 """ |
155 """ |
150 Public method to enable the auto update function. |
156 Public method to enable the auto update function. |
151 |
157 |
152 @param auto status of the auto update function (boolean) |
158 @param auto status of the auto update function |
|
159 @type bool |
153 """ |
160 """ |
154 self.autoUpdate = auto |
161 self.autoUpdate = auto |
155 |
162 |
156 def getAutoUpdate(self): |
163 def getAutoUpdate(self): |
157 """ |
164 """ |
158 Public method to retrieve the status of the auto update function. |
165 Public method to retrieve the status of the auto update function. |
159 |
166 |
160 @return status of the auto update function (boolean) |
167 @return status of the auto update function |
|
168 @rtype bool |
161 """ |
169 """ |
162 return self.autoUpdate |
170 return self.autoUpdate |
163 |
171 |
164 def checkStatus(self): |
172 def checkStatus(self): |
165 """ |
173 """ |
182 |
190 |
183 def clearCachedState(self, name): |
191 def clearCachedState(self, name): |
184 """ |
192 """ |
185 Public method to clear the cached VCS state of a file/directory. |
193 Public method to clear the cached VCS state of a file/directory. |
186 |
194 |
187 @param name name of the entry to be cleared (string) |
195 @param name name of the entry to be cleared |
|
196 @type str |
188 """ |
197 """ |
189 key = self.project.getRelativePath(name) |
198 key = self.project.getRelativePath(name) |
190 with contextlib.suppress(KeyError): |
199 with contextlib.suppress(KeyError): |
191 del self.reportedStates[key] |
200 del self.reportedStates[key] |
192 |
201 |
208 <li>"?" path is not tracked</li> |
217 <li>"?" path is not tracked</li> |
209 <li>"!" path is missing</li> |
218 <li>"!" path is missing</li> |
210 <li>" " path is back at normal</li> |
219 <li>" " path is back at normal</li> |
211 </ul> |
220 </ul> |
212 |
221 |
213 @return tuple of flag indicating successful operation (boolean) and |
222 @return tuple of flag indicating successful operation and |
214 a status message in case of non successful operation (string) |
223 a status message in case of non successful operation |
|
224 @rtype tuple of (bool, str) |
215 @exception NotImplementedError to indicate that this method must be |
225 @exception NotImplementedError to indicate that this method must be |
216 implemented by a subclass |
226 implemented by a subclass |
217 """ |
227 """ |
218 raise NotImplementedError("Not implemented") |
228 raise NotImplementedError("Not implemented") |
219 |
229 |