§
    BP„jª
  ã                   óX   — d Z ddlZddlZddlmZ ddlmZ  G d„ dej        ¦  «        ZdS )zYUtilities for OAuth.

Utilities for making it easier to work with OAuth 2.0
credentials.
é    N)Ú_helpers)Úclientc                   ó:   ‡ — e Zd ZdZˆ fd„Zd„ Zd„ Zd„ Zd„ Zˆ xZ	S )ÚStoragez:Store and retrieve a single credential to and from a file.c                 óŠ   •— t          t          | ¦  «                             t          j        ¦   «         ¬¦  «         || _        d S )N)Úlock)Úsuperr   Ú__init__Ú	threadingÚLockÚ	_filename)ÚselfÚfilenameÚ	__class__s     €úV/root/disk_3tb/conda_envs/Huy-visual/lib/python3.11/site-packages/oauth2client/file.pyr
   zStorage.__init__   s7   ø€ Ý�g�tÑÔ×%Ò%­9¬>Ñ+;Ô+;Ð%Ñ<Ô<Ð<Ø!ˆŒˆˆó    c                 ój  — d}t          j        | j        ¦  «         	 t          | j        d¦  «        }|                     ¦   «         }|                     ¦   «          n# t          $ r |cY S w xY w	 t          j         	                    |¦  «        }| 
                    | ¦  «         n# t          $ r Y nw xY w|S )zªRetrieve Credential from file.

        Returns:
            oauth2client.client.Credentials

        Raises:
            IOError if the file is a symbolic link.
        NÚrb)r   Úvalidate_filer   ÚopenÚreadÚcloseÚIOErrorr   ÚCredentialsÚnew_from_jsonÚ	set_storeÚ
ValueError)r   ÚcredentialsÚfÚcontents       r   Ú
locked_getzStorage.locked_get#   sÏ   € ð ˆÝÔ˜tœ~Ñ.Ô.Ð.ð	Ý�T”^ TÑ*Ô*ˆAØ—f’f‘h”hˆGØ�GŠG‰IŒIˆIˆIøÝð 	ð 	ð 	ØÐÐÐð	øøøð	Ý Ô,×:Ò:¸7ÑCÔCˆKØ×!Ò! $Ñ'Ô'Ð'Ð'øÝð 	ð 	ð 	ØˆDð	øøøð Ðs#   �=A ÁA*Á)A*Á.4B# Â#
B0Â/B0c                 ó$  — t           j                             | j        ¦  «        skt          j        d¦  «        }	 t          | j        d¦  «                             ¦   «          t          j        |¦  «         dS # t          j        |¦  «         w xY wdS )z½Create an empty file if necessary.

        This method will not initialize the file. Instead it implements a
        simple version of "touch" to ensure the file has been created.
        é   za+bN)ÚosÚpathÚexistsr   Úumaskr   r   )r   Ú	old_umasks     r   Ú_create_file_if_neededzStorage._create_file_if_needed=   s‚   € õ Œw�~Š~˜dœnÑ-Ô-ð 	$Ýœ ™œˆIð$Ý�T”^ UÑ+Ô+×1Ò1Ñ3Ô3Ð3å”˜Ñ#Ô#Ð#Ð#Ð#ø•”˜Ñ#Ô#Ð#Ð#øøøð	$ð 	$s   º'A7 Á7Bc                 ó   — |                       ¦   «          t          j        | j        ¦  «         t	          | j        d¦  «        }|                     |                     ¦   «         ¦  «         |                     ¦   «          dS )z·Write Credentials to file.

        Args:
            credentials: Credentials, the credentials to store.

        Raises:
            IOError if the file is a symbolic link.
        ÚwN)r)   r   r   r   r   ÚwriteÚto_jsonr   )r   r   r   s      r   Ú
locked_putzStorage.locked_putJ   si   € ð 	×#Ò#Ñ%Ô%Ð%ÝÔ˜tœ~Ñ.Ô.Ð.Ý�” Ñ%Ô%ˆØ	�Š�×#Ò#Ñ%Ô%Ñ&Ô&Ð&Ø	�Š‰	Œ	ˆ	ˆ	ˆ	r   c                 ó8   — t          j        | j        ¦  «         dS )zpDelete Credentials file.

        Args:
            credentials: Credentials, the credentials to store.
        N)r$   Úunlinkr   )r   s    r   Úlocked_deletezStorage.locked_deleteY   s   € õ 	Œ	�$”.Ñ!Ô!Ð!Ð!Ð!r   )
Ú__name__Ú
__module__Ú__qualname__Ú__doc__r
   r!   r)   r.   r1   Ú__classcell__)r   s   @r   r   r      sz   ø€ € € € € ØDÐDð"ð "ð "ð "ð "ðð ð ð4$ð $ð $ðð ð ð"ð "ð "ð "ð "ð "ð "r   r   )r5   r$   r   Úoauth2clientr   r   r   © r   r   ú<module>r9      sŠ   ððð ð 
€	€	€	Ø Ð Ð Ð à !Ð !Ð !Ð !Ð !Ð !Ø Ð Ð Ð Ð Ð ðC"ð C"ð C"ð C"ð C"ˆfŒnñ C"ô C"ð C"ð C"ð C"r   