Edit File: rhnChannel.cpython-36.pyc
3 ��c�������������������@���s����d�dl�mZ�d�dl�mZ�d�dl�mZ�d�dl�mZ�d�dlZejddd�Zeed �sXeje_ ej Z G�d d��d�ZG�dd ��d �Zddd�Z g�Zdaddd�Zdd��Zdd��Zdd��ZdS�)�����)�up2dateAuth)� up2dateErrors)�config)� rhnserverNzrhn-client-toolsT)Zfallback�ugettextc���������������@���sD���e�Zd�Zdd��Zdd��Zdd��Zdd��Zd d ��Zdd��Zd d��Z dS�)� rhnChannelc�������������K���s*���i�|�_�x|j��D�]}||�|�j�|<�qW�d�S�)N)�dict�keys)�self�kwargs�kw��r ���� /usr/lib/python3.6/rhnChannel.py�__init__���s����zrhnChannel.__init__c�������������C���s ���|�j�|�S�)N)r���)r ����itemr ���r ���r����__getitem__���s����zrhnChannel.__getitem__c�������������C���s���||�j�|<�d�S�)N)r���)r ���r����valuer ���r ���r����__setitem__���s����zrhnChannel.__setitem__c�������������C���s���|�j�d�|j�d�kS�)N�name)r���)r ����otherr ���r ���r����__lt__ ���s����zrhnChannel.__lt__c�������������C���s ���|�j�j��S�)N)r���r ���)r ���r ���r ���r���r ���#���s����zrhnChannel.keysc�������������C���s ���|�j�j��S�)N)r����values)r ���r ���r ���r���r���&���s����zrhnChannel.valuesc�������������C���s ���|�j�j��S�)N)r����items)r ���r ���r ���r���r���)���s����zrhnChannel.itemsN) �__name__� __module__�__qualname__r���r���r���r���r ���r���r���r ���r ���r ���r���r������s���r���c���������������@���s<���e�Zd�Zdd��Zdd��Zdd��Zdd��Zd d ��Zdd��Zd S�)�rhnChannelListc�������������C���s ���g�|�_�d�S�)N)�list)r ���r ���r ���r���r���-���s����zrhnChannelList.__init__c�������������C���s���|�j�j|��d�S�)N)r����append)r ����channelr ���r ���r���� addChannel2���s����zrhnChannelList.addChannelc�������������C���s���|�j�S�)N)r���)r ���r ���r ���r����channels6���s����zrhnChannelList.channelsc�������������C���s$���x|�j�D�]}|d�|kr|S�qW�d�S�)N�label)r���)r ����channelnamer���r ���r ���r���� getByLabel9���s����zrhnChannelList.getByLabelc�������������C���s ���|�j�|�S�)N)r$���)r ���r#���r ���r ���r���� getByName=���s����zrhnChannelList.getByNamec�������������C���s.���g�}x$|�j�D�]}|d�|kr|j|��qW�|S�)N�type)r���r���)r ���r&���r!���r���r ���r ���r���� getByType@���s ����zrhnChannelList.getByTypeN) r���r���r���r���r ���r!���r$���r%���r'���r ���r ���r ���r���r���,���s���r���c�������������C���sd���g�}t�|�d�}xP|j��D�]D}|d�dkrR|d�|d<�d|d�|d�|d�f�|d<�|j|��qW�|S�) N)�timeoutr&����up2dater"���r���z%s channel %s from %s�url�description)�getChannelsr!���r���)r(���r!���ZsourceChannelsZ sourceChannelr ���r ���r����getChannelDetailsJ���s���� r-���c������� ������C���s����t�j��}t�r�|��r�t��atj|d�}tj��s<tj t d���|jjtj���}xl|D�]d}|rh|d�|krhqRt dt�j��d�}x2|j��D�]&}|dkr�|d�|d<�q�||�||<�q�W�tj|��qRW�ttj�dkr�tjt d ���tS�) zG return rhnChannelList containing list of channel we are subscribed to )r(���zUnable to Locate SystemIdr"���r)���)r&���r*���Z last_modified�versionr���zEThis system may not be updated until it is associated with a channel.)r���ZinitUp2dateConfig�selected_channelsr���r���� RhnServerr����getSystemIdr���ZNoSystemIdError�_r)���ZlistChannelsr���ZgetServerlURLFromMirrorr ���r ����lenr���ZNoChannelsError) �force�label_whitelistr(���Zcfg�sZup2dateChannelsZchanr����keyr ���r ���r���r,���]���s&���� r,���c�������������C���s ���d�a�ttdd��|���}t|d�S�)Nc�������������S���s���|�dfS�)N����r ���)�xr ���r ���r����<lambda>���s����zsetChannels.<locals>.<lambda>)r5���)r/���r����mapr,���)ZtempchannelsZ whitelistr ���r ���r����setChannels|���s����r<���c�������������C���s���t�j��}|jjtj��|�||�S�)N)r���r0���r)����subscribeChannelsr���r1���)r!����username�passwdr6���r ���r ���r���r=�������s����r=���c�������������C���s���t�j��}|jjtj��|�||�S�)N)r���r0���r)����unsubscribeChannelsr���r1���)r!���r>���r?���r6���r ���r ���r���r@�������s����r@���)N)NNN)Zup2date_clientr���r���r���r����gettextZtranslation�t�hasattrr���r2���r���r���r-���Zcmdline_pkgsr/���r,���r<���r=���r@���r ���r ���r ���r����<module>���s"���