3 g@sddlmZddlmZddlmZddlmZddlZejdddZeed sXeje_ ej Z Gd d d Z Gd d d Z dddZ gZdadddZddZddZddZdS)) up2dateAuth) up2dateErrors)config) rhnserverNzrhn-client-toolsT)Zfallbackugettextc@sDeZdZddZddZddZddZd d Zd d Zd dZ dS) rhnChannelcKs*i|_x|jD]}|||j|<qWdS)N)dictkeys)selfkwargskwr /usr/lib/python3.6/rhnChannel.py__init__szrhnChannel.__init__cCs |j|S)N)r)r itemr r r __getitem__szrhnChannel.__getitem__cCs||j|<dS)N)r)r rvaluer r r __setitem__szrhnChannel.__setitem__cCs|jd|jdkS)Nname)r)r otherr r r__lt__ szrhnChannel.__lt__cCs |jjS)N)rr )r r r rr #szrhnChannel.keyscCs |jjS)N)rvalues)r r r rr&szrhnChannel.valuescCs |jjS)N)ritems)r r r rr)szrhnChannel.itemsN) __name__ __module__ __qualname__rrrrr rrr r r rrsrc@s<eZdZddZddZddZddZd d Zd d Zd S)rhnChannelListcCs g|_dS)N)list)r r r rr-szrhnChannelList.__init__cCs|jj|dS)N)rappend)r channelr r r addChannel2szrhnChannelList.addChannelcCs|jS)N)r)r r r rchannels6szrhnChannelList.channelscCs$x|jD]}|d|kr|SqWdS)Nlabel)r)r channelnamerr r r getByLabel9s  zrhnChannelList.getByLabelcCs |j|S)N)r$)r r#r r r getByName=szrhnChannelList.getByNamecCs.g}x$|jD]}|d|kr |j|q W|S)Ntype)rr)r r&r!rr r r getByType@s   zrhnChannelList.getByTypeN) rrrrr r!r$r%r'r r r rr,s rcCsdg}t|d}xP|jD]D}|ddkrR|d|d<d|d|d|df|d<|j|qW|S) N)timeoutr&up2dater"rz%s channel %s from %surl description) getChannelsr!r)r(r!ZsourceChannelsZ sourceChannelr r rgetChannelDetailsJs   r-c Cstj}t r| rtatj|d}tjsszsetChannels..)r5)r/rmapr,)Z tempchannelsZ whitelistr r r setChannels|sr<cCstj}|jjtj|||S)N)rr0r)subscribeChannelsrr1)r!usernamepasswdr6r r rr=sr=cCstj}|jjtj|||S)N)rr0r)unsubscribeChannelsrr1)r!r>r?r6r r rr@sr@)N)NNN)Zup2date_clientrrrrgettextZ translationthasattrrr2rrr-Z cmdline_pkgsr/r,r<r=r@r r r rs"