--- a/src/eric7/WebBrowser/Sync/FtpSyncHandler.py Fri Dec 22 13:57:47 2023 +0100 +++ b/src/eric7/WebBrowser/Sync/FtpSyncHandler.py Fri Dec 22 17:24:07 2023 +0100 @@ -26,16 +26,11 @@ """ Class implementing a synchronization handler using FTP. - @signal syncStatus(type_, message) emitted to indicate the synchronization - status (string one of "bookmarks", "history", "passwords", - "useragents" or "speeddial", string) - @signal syncError(message) emitted for a general error with the error - message (string) - @signal syncMessage(message) emitted to send a message about - synchronization (string) - @signal syncFinished(type_, done, download) emitted after a - synchronization has finished (string one of "bookmarks", "history", - "passwords", "useragents" or "speeddial", boolean, boolean) + @signal syncStatus(type_, message) emitted to indicate the synchronization status + @signal syncError(message) emitted for a general error with the error message + @signal syncMessage(message) emitted to send a message about synchronization + @signal syncFinished(type_, done, download) emitted after a synchronization + has finished """ syncStatus = pyqtSignal(str, str) @@ -47,7 +42,8 @@ """ Constructor - @param parent reference to the parent object (QObject) + @param parent reference to the parent object + @type QObject """ super().__init__(parent) @@ -62,7 +58,7 @@ Public method to do the initial check. @param forceUpload flag indicating a forced upload of the files - (boolean) + @type bool """ if not Preferences.getWebBrowser("SyncEnabled"): return @@ -121,7 +117,8 @@ """ Private method to connect to the FTP server and log in. - @return flag indicating a successful log in (boolean) + @return flag indicating a successful log in + @rtype bool """ self.__ftp.connect( Preferences.getWebBrowser("SyncFtpServer"), @@ -166,7 +163,8 @@ """ Private slot handling the receipt of directory listing lines. - @param line the received line of the directory listing (string) + @param line the received line of the directory listing + @type str """ try: urlInfo = self.__dirLineParser.parseLine(line) @@ -188,12 +186,13 @@ """ Private method to downlaod the given file. - @param type_ type of the synchronization event (string one - of "bookmarks", "history", "passwords", "useragents" or - "speeddial") - @param fileName name of the file to be downloaded (string) + @param type_ type of the synchronization event (one of + "bookmarks", "history", "passwords", "useragents" or "speeddial") + @type str + @param fileName name of the file to be downloaded + @type str @param timestamp time stamp in seconds of the file to be downloaded - (integer) + @type int """ self.syncStatus.emit(type_, self._messages[type_]["RemoteExists"]) buffer = io.BytesIO() @@ -216,9 +215,12 @@ """ Private method receiving the downloaded data. - @param buffer reference to the buffer (io.BytesIO) - @param data byte string to store in the buffer (bytes) - @return number of bytes written to the buffer (integer) + @param buffer reference to the buffer + @type io.BytesIO + @param data byte string to store in the buffer + @type bytes + @return number of bytes written to the buffer + @rtype int """ res = buffer.write(data) QCoreApplication.processEvents() @@ -228,11 +230,13 @@ """ Private method to upload the given file. - @param type_ type of the synchronization event (string one - of "bookmarks", "history", "passwords", "useragents" or - "speeddial") - @param fileName name of the file to be uploaded (string) - @return flag indicating success (boolean) + @param type_ type of the synchronization event (one of "bookmarks", + "history", "passwords", "useragents" or "speeddial") + @type str + @param fileName name of the file to be uploaded + @type str + @return flag indicating success + @rtype bool """ res = False data = self.readFile(fileName, type_) @@ -258,10 +262,11 @@ """ Private method to do the initial synchronization of the given file. - @param type_ type of the synchronization event (string one - of "bookmarks", "history", "passwords", "useragents" or - "speeddial") - @param fileName name of the file to be synchronized (string) + @param type_ type of the synchronization event (one of "bookmarks", + "history", "passwords", "useragents" or "speeddial") + @type str + @param fileName name of the file to be synchronized + @type str """ if ( not self.__forceUpload @@ -327,10 +332,11 @@ """ Private method to synchronize the given file. - @param type_ type of the synchronization event (string one - of "bookmarks", "history", "passwords", "useragents" or - "speeddial") - @param fileName name of the file to be synchronized (string) + @param type_ type of the synchronization event (one of "bookmarks", + "history", "passwords", "useragents" or "speeddial") + @type str + @param fileName name of the file to be synchronized + @type str """ if self.__state == "initializing": return