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: //lib/python3.9/site-packages/up2date_client/__pycache__/capabilities.cpython-39.pyc
a

c8h�	@s�ddlmZddlmZzddlZWney>ddlZYn0ddlZejddd�Ze	ed�sheje_
ej
Zdd	idd
idd
idd
idd
idd
idd
idd
id�Zdd
�Z
Gdd�dej�ZdS)�)�config)�
up2dateErrorsNzrhn-client-toolsT)�fallback�ugettext�versionZ21�1)�caneatCheese�supportsAutoUp2dateOption�registration.finish_message� xmlrpc.packages.extended_profile�registration.delta_packages� registration.update_contact_info�$registration.extended_update_support�registration.smbiosc		Cs�d}|�d�}g}|D]�}zdd�|�dd�D�\}}WntyNYqYn0|�dd�\}}|ddkrttd	�|dd�}||d
�}|�||f�q|S)N�,cSsg|]}|���qS�)�strip)�.0�irr�?/usr/lib/python3.9/site-packages/up2date_client/capabilities.py�
<listcomp>#�zparseCap.<locals>.<listcomp>�=��(����)z2something broke in parsing the capabilited headers)r�value)�split�
ValueError�print�append)	Z	capstringrZcaps�capslist�capZkey_version�keyr�datarrr�parseCaps


r&c@sNeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	ddd�Z
dS)�CapabilitiescCs&tj�|�i|_t|_t��|_dS�N)�UserDict�__init__�missingCaps�
neededCapsrZinitUp2dateConfig�cfg)�selfrrrr*:szCapabilities.__init__cCsB|��D]4\}}|��dkrt|�}|D]\}}||j|<q(qdS)Nzx-rhn-server-capability)�items�lowerr&r%)r.Zheadersr$�valr"r#r%rrr�populateCs
zCapabilities.populatecCsx|�d�}|dkrF|�d�}|d}|d}tt|�t|�d�}|S|�d�}t|�dkrndd�|D�}|St|�gS)N�-rr�:cSsg|]}t|��qSr)�int)r�arrrrWrz0Capabilities.parseCapVersion.<locals>.<listcomp>)�findr�ranger5�len)r.Z
versionString�index�rng�start�endZversionsZversrrr�parseCapVersionKs


zCapabilities.parseCapVersioncCsZ||jvr"td�|}d|j|<n4|j|}t|d�|�|d�vrV|j||j|<dS)NzXThis client requires the server to support %s, which the current server does not supportr)r%�_r+r5r>r,)r.r#ZcapvalueZerrstrr%rrr�validateCap\s
�
zCapabilities.validateCapcCs.|j��D]}|�||j|�q
|��dSr()r,�keysr@�workaroundMissingCaps)r.r$rrr�validatehszCapabilities.validatecCs,||jvrd|j|<|j|=n
d|j|<dS)Nrr)�tmpCapsr-)r.r$Z
configItemrrr�	setConfigns


zCapabilities.setConfigc	CsH|j|_d}||jvr |j|=ndddddddd	�}|��D]}|�|||�q<g}g}t|j�r�|jD]4}|j|}|dkr�|�||f�qj|�||f�qjd
}g}t|�r�|D]@\}}|d||d|j|df}|�|||j|d
��q�t|��r.|D](\}}|d|}|�||d
d
���qt|��rDt�||��dS)Nrr	ZsupportsFinishMessageZsupportsUpdateContactInfoZsupportsDeltaPackagesZsupportsExtendedPackageProfileZsupportsEUSZsupportsSMBIOS)r	r
r
rrrr�z3Needs %s of version: %s but server has version: %s
r)ZcapName�capInfoZ
serverVersionz5Needs %s but server does not support that capability
)	r+rDrArEr9r!r%rZServerCapabilityError)	r.r$Z
capsConfigMapr+ZwrongVersionCapsr#rGZ	errStringZ	errorListrrrrBusJ

	�


�

z"Capabilities.workaroundMissingCapsNcCsR|dust|���sJ�||jvr&dS|rN|j|}t|�|�|d�vrNdSdS)a�Checks if the server supports a capability and optionally a version.
        Returns True or False.

        This complements the neededCaps mechanism provided by this module.
        Using hasCapability makes it easier to do something only if the server
        supports it or to put workaround code in the user of this class. The
        neededCaps mechanism makes it easier to put workaround code in this
        module, which makes sense if it is to be shared.

        'capability' should be a string such as 'registration.foobar'. It can
        be a capability in 'neededCaps' above or one that isn't there. 'version'
        can be a string (where isdigit() is True) or an int.

        NFrT)�str�isdigitr%r5r>)r.Z
capabilityrr%rrr�
hasCapability�s

zCapabilities.hasCapability)N)�__name__�
__module__�__qualname__r*r2r>r@rCrErBrJrrrrr'9s	<r')Zup2date_clientrrr)�ImportError�collections�gettext�translation�t�hasattrrr?r,r&r'rrrr�<module>s*
�