fsspec/implementations/cached.py
def load_cache(self):
        """Read set of stored blocks from file"""
        cached_files = []
        for storage in self.storage:
            fn = os.path.join(storage, "cache")
            if os.path.exists(fn):
                with open(fn, "rb") as f:
                    # TODO: consolidate blocks here
                    loaded_cached_files = pickle.load(f)
                    for c in loaded_cached_files.values():
                        if isinstance(c["blocks"], list):
                            c["blocks"] = set(c["blocks"])
                    cached_files.append(loaded_cached_files)
            else:
                cached_files.append({})
        self._mkcache()
        self.cached_files = cached_files or [{}]
        self.last_cache = time.time()
Read set of stored blocks from file
Read set of stored blocks from file
Read set of stored blocks from file
def load_cache(self):
        cached_files = []
        for storage in self.storage:
            fn = os.path.join(storage, "cache")
            if os.path.exists(fn):
                with open(fn, "rb") as f:
                    loaded_cached_files = pickle.load(f)
                    for c in loaded_cached_files.values():
                        if isinstance(c["blocks"], list):
                            c["blocks"] = set(c["blocks"])
                    cached_files.append(loaded_cached_files)
            else:
                cached_files.append({})
        self._mkcache()
        self.cached_files = cached_files or [{}]
        self.last_cache = time.time()
def load_cache ( self ) : cached_files = [ ] for storage in self . storage : fn = os . path . join ( storage , "cache" ) if os . path . exists ( fn ) : with open ( fn , "rb" ) as f : loaded_cached_files = pickle . load ( f ) for c in loaded_cached_files . values ( ) : if isinstance ( c [ "blocks" ] , list ) : c [ "blocks" ] = set ( c [ "blocks" ] ) cached_files . append ( loaded_cached_files ) else : cached_files . append ( { } ) self . _mkcache ( ) self . cached_files = cached_files or [ { } ] self . last_cache = time . time ( )
Read set of stored blocks from file
Read set of stored blocks from file
"""Read set of stored blocks from file""" # TODO: consolidate blocks here
self