def cache_path(): "Returns the path to the favicon cache directory, making it if it doesn't exist." p = get_cache_root() / FAVICON_CACHE_DIR if not p.isdir(): p.makedirs() return p
def cache_path(): "Returns the path to the favicon cache directory, making it if it doesn't exist." p = get_cache_root() / FAVICON_CACHE_DIR if not p.isdir(): p.makedirs() return p
def load_local_blob(username, blobname): cache_path = cache.get_cache_root(user=True, username=username) / BlobManager.CACHE_FOLDER try: pth = cache_path / blobname if not os.path.isfile(pth): return None data = pth.bytes() blob = load_cache_from_data_disk(blobname, data) return blob.data except Exception: return None
def load_local_blob(username, blobname): cache_path = cache.get_cache_root( user=True, username=username) / BlobManager.CACHE_FOLDER try: pth = cache_path / blobname if not os.path.isfile(pth): return None data = pth.bytes() blob = load_cache_from_data_disk(blobname, data) return blob.data except Exception: return None
def get_cache_path(self): ''' Net data that goes to and from the server is cached locally at the following location. ''' un = self.profile.username import util.cacheable as cache cache_path = cache.get_cache_root(user = True) / self.CACHE_FOLDER # Make the cache directory if it doesn't exist. try: if not pathexists(cache_path): os.makedirs(cache_path) except Exception, e: log.critical('exception during makedirs: %r', e)
def get_cache_path(self): ''' Net data that goes to and from the server is cached locally at the following location. ''' un = self.profile.username import util.cacheable as cache cache_path = cache.get_cache_root(user=True) / self.CACHE_FOLDER # Make the cache directory if it doesn't exist. try: if not pathexists(cache_path): os.makedirs(cache_path) except Exception, e: log.critical('exception during makedirs: %r', e)
def db_file(self): return cacheable.get_cache_root(user=True) / 'alias_cache_v1.db'
def server_file(username): "Where to store the server side account hash and server order" cache_path = cache.get_cache_root(user=True) return cache_path / "server.accounts"
def local_file(username): "Where to store account and local order data." cache_path = cache.get_cache_root(user=True) return cache_path / "local.accounts"
def server_file(username): 'Where to store the server side account hash and server order' cache_path = cache.get_cache_root(user=True) return cache_path / 'server.accounts'
def local_file(username): 'Where to store account and local order data.' cache_path = cache.get_cache_root(user=True) return cache_path / 'local.accounts'