Server : LiteSpeed
System : Linux server51.dnsbootclub.com 4.18.0-553.62.1.lve.el8.x86_64 #1 SMP Mon Jul 21 17:50:35 UTC 2025 x86_64
User : nandedex ( 1060)
PHP Version : 8.1.33
Disable Function : NONE
Directory :  /opt/cppython/lib/python3.8/site-packages/oauth2client/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]


Current File : //opt/cppython/lib/python3.8/site-packages/oauth2client/__pycache__/file.cpython-38.pyc
U

O��g�
�@sBdZddlZddlZddlmZddlmZGdd�dej�ZdS)zYUtilities for OAuth.

Utilities for making it easier to work with OAuth 2.0
credentials.
�N)�_helpers)�clientcs@eZdZdZ�fdd�Zdd�Zdd�Zdd	�Zd
d�Z�Z	S)�Storagez:Store and retrieve a single credential to and from a file.cs tt|�jt��d�||_dS)N)�lock)�superr�__init__�	threading�Lock�	_filename)�self�filename��	__class__��>/opt/cppython/lib/python3.8/site-packages/oauth2client/file.pyrszStorage.__init__cCs~d}t�|j�z t|jd�}|��}|��Wntk
rH|YSXztj�	|�}|�
|�Wntk
rxYnX|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�CredentialsZ
new_from_jsonZ	set_store�
ValueError)r�credentials�f�contentrrr�
locked_get#s	
zStorage.locked_getc	Cs>tj�|j�s:t�d�}zt|jd���W5t�|�XdS)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.
        �za+bN)�os�path�existsr
�umaskrr)rZ	old_umaskrrr�_create_file_if_needed=s

zStorage._create_file_if_neededcCs:|��t�|j�t|jd�}|�|���|��dS)z�Write Credentials to file.

        Args:
            credentials: Credentials, the credentials to store.

        Raises:
            IOError if the file is a symbolic link.
        �wN)r"rrr
r�write�to_jsonr)rrrrrr�
locked_putJs
	zStorage.locked_putcCst�|j�dS)zpDelete Credentials file.

        Args:
            credentials: Credentials, the credentials to store.
        N)r�unlinkr
)rrrr�
locked_deleteYszStorage.locked_delete)
�__name__�
__module__�__qualname__�__doc__rrr"r&r(�
__classcell__rrr
rrs
r)r,rrZoauth2clientrrrrrrr�<module>s


F1le Man4ger