Beispiel #1
0
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
Beispiel #2
0
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
Beispiel #3
0
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
Beispiel #4
0
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
Beispiel #5
0
    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)
Beispiel #6
0
    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)
Beispiel #7
0
 def db_file(self):
     return cacheable.get_cache_root(user=True) / 'alias_cache_v1.db'
Beispiel #8
0
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"
Beispiel #9
0
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"
Beispiel #10
0
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'
Beispiel #11
0
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'