o
    x¡·iý  ã                   @  sœ   U d Z ddlmZ ddlmZmZ ddlmZmZ ddl	m
Z
mZ er5ddlmZ ddlmZ ddlmZ d	Zd
ed< G dd„ deƒZG dd„ deeƒZdS )zStorage handler.é    )Úannotations)ÚABCÚabstractmethod)ÚTYPE_CHECKINGÚFinal)ÚFilePathStrÚURIStr)ÚParseResult)ÚArtifact)ÚArtifactManifestEntryi€–˜ z
Final[int]ÚDEFAULT_MAX_OBJECTSc                   @  s4   e Zd Ze	dddd	„ƒZe	
		
dddd„ƒZd
S )Ú_BaseStorageHandlerFÚmanifest_entryr   ÚlocalÚboolÚreturnúURIStr | FilePathStrc                 C  ó   t ‚)a  Load a file or directory given the corresponding index entry.

        Args:
            manifest_entry: The index entry to load
            local: Whether to load the file locally or not

        Returns:
            A path to the file represented by `index_entry`
        ©ÚNotImplementedError)Úselfr   r   © r   úW/home/ubuntu/.local/lib/python3.10/site-packages/wandb/sdk/artifacts/storage_handler.pyÚ	load_path   s   z_BaseStorageHandler.load_pathNTÚartifactr
   ÚpathÚnameú
str | NoneÚchecksumÚmax_objectsú
int | Noneúlist[ArtifactManifestEntry]c                 C  r   )a§  Store the file or directory at the given path to the specified artifact.

        Args:
            path: The path to store
            name: If specified, the logical name that should map to `path`
            checksum: Whether to compute the checksum of the file
            max_objects: The maximum number of objects to store

        Returns:
            A list of manifest entries to store within the artifact
        r   )r   r   r   r   r   r   r   r   r   Ú
store_path%   s   z_BaseStorageHandler.store_path)F)r   r   r   r   r   r   )NTN)r   r
   r   r   r   r   r   r   r   r    r   r!   )Ú__name__Ú
__module__Ú__qualname__r   r   r"   r   r   r   r   r      s    ýúr   c                   @  s   e Zd Zeddd„ƒZdS )	ÚStorageHandlerÚ
parsed_urlr	   r   r   c                 C  r   )z‹Checks whether this handler can handle the given url.

        Returns:
            Whether this handler can handle the given url.
        r   )r   r'   r   r   r   Ú
can_handle=   s   zStorageHandler.can_handleN)r'   r	   r   r   )r#   r$   r%   r   r(   r   r   r   r   r&   <   s    r&   N)Ú__doc__Ú
__future__r   Úabcr   r   Útypingr   r   Úwandb.sdk.lib.pathsr   r   Úurllib.parser	   Úwandb.sdk.artifacts.artifactr
   Ú+wandb.sdk.artifacts.artifact_manifest_entryr   r   Ú__annotations__r   r&   r   r   r   r   Ú<module>   s    )