def downloadEntirePath(self): self.totalSize = self.getFullSize() try: for (ftp_curpath, ftp_dirs, ftp_files) in self.host.walk(self.host.curdir): self.downloadFolderFiles(ftp_curpath) hashgen.saveHashDict(self.localHashDict, self.updaterDir) except Exception as exc: raise(exc)
def calculateDiffer(self): if os.path.exists(os.path.join(self.updaterDir, 'updater.dat')) and os.path.exists(self.download_path): self.downloadDiffer(self.fileDiffer.added()) self.downloadDiffer(self.fileDiffer.changed()) self.removeDiffer(self.fileDiffer.removed()) hashgen.saveHashDict(self.localHashDict, self.updaterDir) else: try: try: os.remove(os.path.join(self.updaterDir, 'updater.dat')) except: pass self.downloadEntirePath() except Exception as exc: raise(exc) os.remove(os.path.join(self.updaterDir, 'updater.dat'))