Esempio n. 1
0
 def clearCache(self):
     cacheDir = common.Paths.cacheDir
     if not os.path.exists(cacheDir):
         os.mkdir(cacheDir, 0777)
         common.log('Cache directory created' + str(cacheDir))
     else:
         size, within_limit = fu.checkQuota(cacheDir)
         if not within_limit:
             fu.clearDirectory(cacheDir)
             common.log('Cache directory purged')
         common.log('Cache Usage:' + str(size))
Esempio n. 2
0
 def clearCache(self):
     cacheDir = common.Paths.cacheDir
     if not os.path.exists(cacheDir):
         os.mkdir(cacheDir, 0777)
         common.log('Cache directory created' + str(cacheDir))
     else:
         size, within_limit = fu.checkQuota(cacheDir)
         if not within_limit:
             fu.clearDirectory(cacheDir)
             common.log('Cache directory purged')
         common.log('Cache Usage:' + str(size))