예제 #1
0
 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)
예제 #2
0
 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)
예제 #3
0
    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)