HEX
Server: Apache
System: Linux a16-asgard6.hospedagemuolhost.com.br 5.14.0-570.52.1.el9_6.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Oct 15 06:39:08 EDT 2025 x86_64
User: maoristu4c3dbd03 (1436)
PHP: 8.1.33
Disabled: NONE
Upload Files
File: //usr/lib64/python3.9/site-packages/rhsmlib/services/__pycache__/config.cpython-39.pyc
a

X�Zh��@sPddlZddlZddlmZmZmZGdd�dejj	�Z
Gdd�dejj	�ZdS)�N)�Iterator�Any�Unioncs�eZdZdZd ejjed��fdd�
Zdd�dd	�Z	e
d�d
d�Zedd
�dd�Z
eedd�dd�Zedd�dd�Zeed�dd�Zed�dd�Zed�dd�Zed�dd�Zed�dd�Z�ZS)!�Configz@
    Class for managing RHSM configuration file (rhsm.conf)
    NF)�parser�auto_persistcs^|r||_ntj��|_||_i|_|j��D]}t||j||j�|j|<q.tt	|��
�dS�N)�_parser�rhsm�configZget_config_parserr�	_sections�sections�
ConfigSection�superr�__init__)�selfrr�s��	__class__��=/usr/lib64/python3.9/site-packages/rhsmlib/services/config.pyrszConfig.__init__��returncCs|j��dSr)r	Zsave�rrrr�persist%szConfig.persistcCs
|j��Sr)r	�defaultsrrrrr(szConfig.defaultsr)�namercCs"||vr|j|Std|��dS)Nz$No configuration section '%s' exists)r�KeyError)rrrrr�__getitem__+s
zConfig.__getitem__��key�valuercCs�z|��Wnty �Yn0||vr>|j�|�|j|=|j�|�t||j||j�|j|<|��D]\}}||j||<qj|jr�|��dSr)	�items�	Exceptionr	�remove_sectionrZadd_sectionrrr)rr r!�k�vrrr�__setitem__0szConfig.__setitem__�r rcCs&|j�|�|j|=|jr"|��dSr)r	r$rrr�rr rrr�__delitem__GszConfig.__delitem__cCs
||jvSr)rr)rrr�__contains__MszConfig.__contains__cCst|j���Sr)�iterr	r
rrrr�__iter__PszConfig.__iter__ccs|j��D]}||Vq
dS)zkAn iterator that yields the actual ConfigSection objects instead of just
        the names of the sections.N)r	r
)rrrrr�
iter_sectionsSszConfig.iter_sectionscCst|j���Sr)�lenr	r
rrrr�__len__YszConfig.__len__cCs0i}t|j���D]\}}t|�||<qd|S�Nz%s)�listrr"�repr)r�resultrrrrr�__repr__\szConfig.__repr__)NF)�__name__�
__module__�__qualname__�__doc__r
r�RhsmConfigParser�boolrr�dictr�strrrr'r*r+rr-r.�intr0r5�
__classcell__rrrrrs
rc@s�eZdZdZd eejjee	d�dd�Z
ed�dd�Zeed	�d
d�Z
eedd
�dd�Zedd	�dd�Zee	d	�dd�Zed�dd�Zdd�dd�Zed�dd�Zeeedfd	�dd�Zeeedfd	�dd�Zee	d	�dd�ZdS)!rzD
    Class representing section in rhsm.conf configuration file
    F)�wrapperr�sectionrcCs||_||_||_||_dSr)�_wrapperr	�_sectionr)rr@rrArrrrrhszConfigSection.__init__rcCst|j�|j��Sr)r,r	�optionsrCrrrrr-pszConfigSection.__iter__r(cCs.||vr|j�|j|�Std||jf��dS�Nz,Property '%s' does not exist in section '%s')r	�getrCrr)rrrrsszConfigSection.__getitem__NrcCs&|j�|j||�|jr"|j��dSr)r	�setrCrrBr)rr r!rrrr'xszConfigSection.__setitem__cCs>||vr(|j�|j|�|jr:|��ntd||jf��dSrE)r	Z
remove_optionrCr�_persistrr)rrrr*}s

zConfigSection.__delitem__cCs|j�|j|�Sr)r	Z
has_optionrCr)rrrr+�szConfigSection.__contains__cCst|j�|j��Sr)r/r	rDrCrrrrr0�szConfigSection.__len__cCs|j��dSr)rBrrrrrrH�szConfigSection._persistcCsd|j�|j�Sr1)r	r"rCrrrrr5�szConfigSection.__repr__cCs|j�|j|�S)z�
        Try to get integer value for given key
        :param key: String with key.
        :return: Return integer value, when key exists. Otherwise, return None.
        )r	�get_intrCr)rrrrI�szConfigSection.get_intcCs|j�|j|�S)z�
        Try to get default value for given key.
        :param key: String with key
        :return: Return string representation of default value, when default value for given key exists.
            Otherwise, return None.
        )r	�get_defaultrCr)rrrrJ�szConfigSection.get_defaultcCs|j�|j|�Sr)r	�has_defaultrCr)rrrrK�szConfigSection.has_default)F)r6r7r8r9rr
rr:r=r;rrr-rrr'r*r+r>r0rHr5rrIrJrKrrrrrcs ��	r)Zrhsm.configr
�collections.abc�collections�typingrrr�abc�MutableMappingrrrrrr�<module>sP