164 venvItem = self.__virtualEnvironments[venvName] |
164 venvItem = self.__virtualEnvironments[venvName] |
165 if not venvItem.is_remote: |
165 if not venvItem.is_remote: |
166 venvPath = venvItem.path |
166 venvPath = venvItem.path |
167 if venvPath: |
167 if venvPath: |
168 if venvItem.is_eric_server: |
168 if venvItem.is_eric_server: |
169 # It is an eric-ide server environment; check it is still valid. |
169 with contextlib.suppress(KeyError): |
170 ericServer = ericApp().getObject("EricServer") |
170 # It is an eric-ide server environment; check it is |
171 if ( |
171 # still valid. |
172 ericServer.isServerConnected() |
172 ericServer = ericApp().getObject("EricServer") |
173 and ericServer.getHost() == venvItem.eric_server |
173 if ( |
174 and not ericServer.getServiceInterface("FileSystem").exists( |
174 ericServer.isServerConnected() |
175 venvPath |
175 and ericServer.getHost() == venvItem.eric_server |
176 ) |
176 and not ericServer.getServiceInterface( |
177 ): |
177 "FileSystem" |
178 del self.__virtualEnvironments[venvName] |
178 ).exists(venvPath) |
179 removed = True |
179 ): |
|
180 del self.__virtualEnvironments[venvName] |
|
181 removed = True |
180 else: |
182 else: |
181 # It is a local environment; check it is still valid. |
183 # It is a local environment; check it is still valid. |
182 if not os.path.exists(venvPath): |
184 if not os.path.exists(venvPath): |
183 del self.__virtualEnvironments[venvName] |
185 del self.__virtualEnvironments[venvName] |
184 removed = True |
186 removed = True |