AnonSec Shell
Server IP : 209.38.156.173  /  Your IP : 216.73.216.122   [ Reverse IP ]
Web Server : Apache/2.4.52 (Ubuntu)
System : Linux lakekumayuhotel 5.15.0-136-generic #147-Ubuntu SMP Sat Mar 15 15:53:30 UTC 2025 x86_64
User : root ( 0)
PHP Version : 8.1.2-1ubuntu2.22
Disable Function : NONE
Domains : 2 Domains
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/lib/python3/dist-packages/certbot/plugins/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     [ BACKUP SHELL ]     [ JUMPING ]     [ MASS DEFACE ]     [ SCAN ROOT ]     [ SYMLINK ]     

Current File : /usr/lib/python3/dist-packages/certbot/plugins/__pycache__/storage.cpython-310.pyc
o

6��aB�@sldZddlZddlZddlmZddlmZddlmZddlm	Z	ddlm
Z
e�e�Z
Gdd	�d	�ZdS)
zPlugin storage class.�N)�Any)�Dict)�errors)�
filesystem)�osc@s@eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dS)�
PluginStoragez4Class implementing storage functionality for pluginscCs||_||_d|_||dS)z�Initializes PluginStorage object storing required configuration
        options.

        :param .configuration.NamespaceConfig config: Configuration object
        :param str classkey: class name to use as root key in storage file

        FN)�_config�	_classkey�_initialized)�self�config�classkey�r�9/usr/lib/python3/dist-packages/certbot/plugins/storage.py�__init__s
	zPluginStorage.__init__cCs&tj�|jjd�|_|��d|_dS)zhInitializes PluginStorage data and reads current state from the disk
        if the storage json exists.z.pluginstorage.jsonTN)r�path�joinr�
config_dir�_storagepath�_loadr
)rrrr�_initialize_storage s
z!PluginStorage._initialize_storagec
Cs�i}d}zt|jd��}|��}Wd�n1swYWn,tyL}z d�|jt|��}tj�|j�rBt	�
|�t�|��WYd}~nd}~wwzt
�|�}Wn#tyw|set	�d|j�nd�|j�}t	�
|�t�|��Ynw||_dS)z�Reads PluginStorage content from the disk to a dict structure

        :raises .errors.PluginStorageError: when unable to open or read the file
        ��rNz1Could not read PluginStorage data file: {0} : {1}z2Plugin storage file %s was empty, no values loadedz$PluginStorage file {0} is corrupted.)�openr�read�IOError�format�strrr�isfile�logger�errorr�PluginStorageError�json�loads�
ValueError�debug�_data)r�data�filedata�fh�e�errmsgrrrr(s@
��
�

�����

��
	zPluginStorage._loadc
Cs|jsd}t�|�t�|��zt�|j�}Wnty4}zd�	t
|��}t�|�t�|��d}~wwz-t�t
�|jtjtjBtjBd�d��}|�|�Wd�WdS1s[wYWdSty�}zd�	|jt
|��}t�|�t�|��d}~ww)z�Saves PluginStorage content to disk

        :raises .errors.PluginStorageError: when unable to serialize the data
            or write it to the filesystem
        z;Unable to save, no values have been added to PluginStorage.z+Could not serialize PluginStorage data: {0}Ni��wz4Could not write PluginStorage data to file {0} : {1})r
rr rr!r"�dumpsr&�	TypeErrorrrr�fdopenrrr�O_WRONLY�O_CREAT�O_TRUNC�writer)rr+�
serializedr*r)rrr�saveFsB

�

����&�
�

��zPluginStorage.savecCs:|js|��|j|jvri|j|j<||j|j|<dS)z�Put configuration value to PluginStorage

        :param str key: Key to store the value to
        :param value: Data to store
        N)r
rr	r&)r�key�valuerrr�putds
zPluginStorage.putcCs|js|��|j|j|S)z�Get configuration value from PluginStorage

        :param str key: Key to get value from the storage

        :raises KeyError: If the key doesn't exist in the storage
        )r
rr&r	)rr6rrr�fetchqszPluginStorage.fetchN)
�__name__�
__module__�__qualname__�__doc__rrrr5r8r9rrrrrs
r)r=r"�logging�typingrr�certbotr�certbot.compatrr�	getLoggerr:rrrrrr�<module>s


Anon7 - 2022
AnonSec Team