10769:33edb81a63b4 | 10770:8b4ff92221da |
---|---|
7 Module implementing the file system interface to the eric-ide server. | 7 Module implementing the file system interface to the eric-ide server. |
8 """ | 8 """ |
9 | 9 |
10 import base64 | 10 import base64 |
11 import contextlib | 11 import contextlib |
12 import logging | |
12 import os | 13 import os |
13 import re | 14 import re |
14 import stat | 15 import stat |
15 | 16 |
16 from PyQt6.QtCore import QByteArray, QEventLoop, QObject, pyqtSlot | 17 from PyQt6.QtCore import QByteArray, QEventLoop, QObject, pyqtSlot |
1407 listing = self.listdir(directory=directory, recursive=True)[2] | 1408 listing = self.listdir(directory=directory, recursive=True)[2] |
1408 for entry in listing: | 1409 for entry in listing: |
1409 _RemoteFsCache[FileSystemUtilities.remoteFileName(entry["path"])] = ( | 1410 _RemoteFsCache[FileSystemUtilities.remoteFileName(entry["path"])] = ( |
1410 entry | 1411 entry |
1411 ) | 1412 ) |
1412 print(f"Remote Cache Size: {len(_RemoteFsCache)} entries") | 1413 logging.getLogger(__name__).debug( |
1414 f"Remote Cache Size: {len(_RemoteFsCache)} entries" | |
1415 ) | |
1413 except OSError as err: | 1416 except OSError as err: |
1414 print("Error in 'populateFsCache()':", str(err)) # noqa: M801 | 1417 print("Error in 'populateFsCache()':", str(err)) # noqa: M801 |
1415 | 1418 |
1416 def removeFromFsCache(self, directory): | 1419 def removeFromFsCache(self, directory): |
1417 """ | 1420 """ |
1421 @type str | 1424 @type str |
1422 """ | 1425 """ |
1423 for entryPath in list(_RemoteFsCache.keys()): | 1426 for entryPath in list(_RemoteFsCache.keys()): |
1424 if entryPath.startswith(directory): | 1427 if entryPath.startswith(directory): |
1425 del _RemoteFsCache[entryPath] | 1428 del _RemoteFsCache[entryPath] |
1426 print(f"Remote Cache Size: {len(_RemoteFsCache)} entries") | 1429 logging.getLogger(__name__).debug( |
1430 f"Remote Cache Size: {len(_RemoteFsCache)} entries" | |
1431 ) |