299 return |
299 return |
300 |
300 |
301 # use idle timeout to check, if we are still connected |
301 # use idle timeout to check, if we are still connected |
302 if self.__connected: |
302 if self.__connected: |
303 self.__idleTimeout() |
303 self.__idleTimeout() |
304 if not self.__connected: |
304 if not self.__connected or self.__ftp.sock is None: |
305 ok = self.__connectAndLogin() |
305 ok = self.__connectAndLogin() |
306 if not ok: |
306 if not ok: |
307 self.syncStatus.emit(type_, self.trUtf8("Cannot log in to FTP host.")) |
307 self.syncStatus.emit(type_, self.trUtf8("Cannot log in to FTP host.")) |
308 return |
308 return |
309 |
309 |
310 # upload the changed file |
310 # upload the changed file |
311 self.__state = "uploading" |
311 self.__state = "uploading" |
312 self.syncStatus.emit(type_, self._messages[type_]["Uploading"]) |
312 self.syncStatus.emit(type_, self._messages[type_]["Uploading"]) |
313 if self.__uploadFile(type_, fileName): |
313 if self.__uploadFile(type_, fileName): |