def clearLatestFolder(self): self.deferredQueue = [] G.deferredManager.removeFromQueue("ACR") sceneId = aToolsMod.getSceneId() idFolder = "%s%s%s"%(self.baseFolderName, os.sep, sceneId) latestFolder = "%s%s%s"%(idFolder, os.sep, self.baseLatestFolderName) aToolsMod.deleteFolderWithUser(latestFolder)
def saveBackup(self): sceneId = aToolsMod.getSceneId() idFolder = "%s%s%s"%(self.baseFolderName, os.sep, sceneId) latestFolder = "%s%s%s"%(idFolder, os.sep, self.baseLatestFolderName) bkpFolder = "%s%s%s"%(idFolder, os.sep, self.baseBackupFolderName) aToolsMod.deleteFolderWithUser(bkpFolder) aToolsMod.renameFolderWithUser(latestFolder, bkpFolder) aToolsMod.deleteFolderWithUser(latestFolder)
def checkAndClearOldFiles(self): allIdFolders = aToolsMod.readFoldersWithUser(self.baseFolderName) timeNow = time.time() for loopIdFolder in allIdFolders: idFolder = "%s%s%s"%(self.baseFolderName, os.sep, loopIdFolder) modDate = None for loopInfoFile in [self.baseLatestFolderName, self.baseBackupFolderName]: infoDataFile = "%s%s%s%s%s%s%s.info"%(G.USER_FOLDER, os.sep, idFolder, os.sep, loopInfoFile, os.sep, self.infoDataFileName) if os.path.isfile(infoDataFile): modDate = os.path.getmtime(infoDataFile) break if not modDate: return if timeNow - modDate >= self.daysToKeepOldFiles: aToolsMod.deleteFolderWithUser(idFolder)