eric6/VCS/StatusMonitorThread.py

changeset 8240
93b8a353c4bf
parent 8218
7c09585bd960
equal deleted inserted replaced
8239:59a9a658618c 8240:93b8a353c4bf
4 # 4 #
5 5
6 """ 6 """
7 Module implementing the VCS status monitor thread base class. 7 Module implementing the VCS status monitor thread base class.
8 """ 8 """
9
10 import contextlib
9 11
10 from PyQt5.QtCore import ( 12 from PyQt5.QtCore import (
11 QThread, QMutex, QWaitCondition, pyqtSignal, QCoreApplication 13 QThread, QMutex, QWaitCondition, pyqtSignal, QCoreApplication
12 ) 14 )
13 15
171 Public method to clear the cached VCS state of a file/directory. 173 Public method to clear the cached VCS state of a file/directory.
172 174
173 @param name name of the entry to be cleared (string) 175 @param name name of the entry to be cleared (string)
174 """ 176 """
175 key = self.project.getRelativePath(name) 177 key = self.project.getRelativePath(name)
176 try: 178 with contextlib.suppress(KeyError):
177 del self.reportedStates[key] 179 del self.reportedStates[key]
178 except KeyError:
179 pass
180 180
181 def _performMonitor(self): 181 def _performMonitor(self):
182 """ 182 """
183 Protected method implementing the real monitoring action. 183 Protected method implementing the real monitoring action.
184 184

eric ide

mercurial