lazydata/storage/local.py
def copy_file_to(self, sha256:str, path:str) -> bool:
        """
        Copy the file from local cache to user's local copy.

        If the file is not available locally it will return False, otherwise return True if successful

        :param config: The project config used to get the remote if the files needs downloading
        :param sha256: The sha256 of the file we need
        :param path: The path where it should be copied
        :return: Returns
        """

        cached_path = self.hash_to_file(sha256)
        path_obj = Path(path)

        if cached_path.exists():
            if path_obj.exists():
                # delete the old file as we'll need to overwrite it
                path_obj.unlink()
            else:
                # we might need to make some directories to pull the file...
                path_obj.parent.mkdir(parents=True, exist_ok=True)

            shutil.copyfile(str(cached_path), str(path))
            return True
        else:
            return False

        Copy the file from local cache to user's local copy.

        If the file is not available locally it will return False, otherwise return True if successful

        :param config: The project config used to get the remote if the files needs downloading
        :param sha256: The sha256 of the file we need
        :param path: The path where it should be copied
        :return: Returns
        
Copy the file from local cache to user's local copy.
If the file is not available locally it will return False, otherwise return True if successful
Copy the file from local cache to user ' s local copy . If the file is not available locally it will return False otherwise return True if successful
def copy_file_to(self, sha256:str, path:str) -> bool:
        cached_path = self.hash_to_file(sha256)
        path_obj = Path(path)
        if cached_path.exists():
            if path_obj.exists():
                path_obj.unlink()
            else:
                path_obj.parent.mkdir(parents=True, exist_ok=True)
            shutil.copyfile(str(cached_path), str(path))
            return True
        else:
            return False
def copy_file_to ( self , sha256 : str , path : str ) -> bool : cached_path = self . hash_to_file ( sha256 ) path_obj = Path ( path ) if cached_path . exists ( ) : if path_obj . exists ( ) : path_obj . unlink ( ) else : path_obj . parent . mkdir ( parents = True , exist_ok = True ) shutil . copyfile ( str ( cached_path ) , str ( path ) ) return True else : return False
Copy the file from local cache to user's local copy.
Copy the file from local cache to user ' s local copy .
"""
        Copy the file from local cache to user's local copy.

        If the file is not available locally it will return False, otherwise return True if successful

        :param config: The project config used to get the remote if the files needs downloading
        :param sha256: The sha256 of the file we need
        :param path: The path where it should be copied
        :return: Returns
        """ # delete the old file as we'll need to overwrite it # we might need to make some directories to pull the file...
None
self
sha256
str
The sha256 of the file we need
The sha256 of the file we need
path
str
The path where it should be copied
The path where it should be copied
config
The project config used to get the remote if the files needs downloading
The project config used to get the remote if the files needs downloading