8 """ |
8 """ |
9 |
9 |
10 import ftplib # secok |
10 import ftplib # secok |
11 import io |
11 import io |
12 import contextlib |
12 import contextlib |
13 |
13 import pathlib |
14 from PyQt6.QtCore import ( |
14 |
15 pyqtSignal, QTimer, QFileInfo, QCoreApplication, QByteArray |
15 from PyQt6.QtCore import pyqtSignal, QTimer, QCoreApplication, QByteArray |
16 ) |
|
17 |
16 |
18 from EricNetwork.EricFtp import EricFtp, EricFtpProxyType, EricFtpProxyError |
17 from EricNetwork.EricFtp import EricFtp, EricFtpProxyType, EricFtpProxyError |
19 |
18 |
20 from .SyncHandler import SyncHandler |
19 from .SyncHandler import SyncHandler |
21 |
20 |
260 if ( |
259 if ( |
261 not self.__forceUpload and |
260 not self.__forceUpload and |
262 self._remoteFiles[type_] in self.__remoteFilesFound |
261 self._remoteFiles[type_] in self.__remoteFilesFound |
263 ): |
262 ): |
264 if ( |
263 if ( |
265 QFileInfo(fileName).lastModified() < |
264 pathlib.Path(fileName).stat().st_mtime < |
266 self.__remoteFilesFound[self._remoteFiles[type_]] |
265 self.__remoteFilesFound[ |
|
266 self._remoteFiles[type_].toSecsSinceEpoch()] |
267 ): |
267 ): |
268 self.__downloadFile( |
268 self.__downloadFile( |
269 type_, fileName, |
269 type_, fileName, |
270 self.__remoteFilesFound[self._remoteFiles[type_]] |
270 self.__remoteFilesFound[self._remoteFiles[type_]] |
271 .toTime_t()) |
271 .toTime_t()) |