403Webshell
Server IP : 35.236.43.222  /  Your IP : 216.73.216.143
Web Server : Apache
System : Linux order-form-vm-001 5.10.0-37-cloud-amd64 #1 SMP Debian 5.10.247-1 (2025-12-11) x86_64
User : deploy ( 1002)
PHP Version : 8.1.31
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /lib/python3/dist-packages/certbot/plugins/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/python3/dist-packages/certbot/plugins/__pycache__/storage.cpython-39.pyc
a

�`k�@sndZddlZddlZddlmZddlmZddlmZddlm	Z	ddlm
Z
e�e�Z
Gdd	�d	e�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|_d|_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�_data�_storagepath)�selfZconfigZclasskey�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�joinrZ
config_dirr�_loadr
)r
rrr�_initialize_storage sz!PluginStorage._initialize_storagec
Cs�i}d}z8t|jd��}|��}Wd�n1s40YWnXty�}z@d�|jt|��}tj�|j�r�t	�
|�t�|��WYd}~n
d}~00zt
�|�}WnFty�|s�t	�d|j�n d�|j�}t	�
|�t�|��Yn0||_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�debugr)r
�dataZfiledata�fh�e�errmsgrrrr(s2*
�
 ��
zPluginStorage._loadc
Cs|jsd}t�|�t�|��zt�|j�}WnFtyt}z.d�	t
|��}t�|�t�|��WYd}~n
d}~00zTt�t
�|jtjtjBtjBd�d��}|�|�Wd�n1s�0YWnLt�y}z2d�	|jt
|��}t�|�t�|��WYd}~n
d}~00dS)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
rrrrr �dumpsr�	TypeErrorrrr�fdopenrrr�O_WRONLY�O_CREAT�O_TRUNC�writer)r
r'Z
serializedr&r%rrr�saveFs8

�
 ��,
�
zPluginStorage.savecCs:|js|��|j|jvr&i|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
rrr	)r
r1rrr�fetchqszPluginStorage.fetchN)
�__name__�
__module__�__qualname__�__doc__rrrr0r3r4rrrrrs
r)r8r ZloggingZacme.magic_typingrrZcertbotrZcertbot.compatrrZ	getLoggerr5r�objectrrrrr�<module>s


Youez - 2016 - github.com/yon3zu
LinuXploit