a c8h§ã@s¾ddlmZddlmZddlmZddlmZddlmZddlZejddd Ze ed ƒsdeje_ ej Z Gd d „d ƒZ Gd d„dƒZ ddd„ZgZdaddd„Zdd„Zdd„Zdd„ZdS)é)Ú up2dateAuth)Ú up2dateLog)Ú up2dateErrors)Úconfig)Ú rhnserverNzrhn-client-toolsT)ÚfallbackÚugettextc@sDeZdZdd„Zdd„Zdd„Zdd„Zd d „Zd d „Zd d„Z dS)Ú rhnChannelcKs&i|_| ¡D]}|||j|<qdS©N©ÚdictÚkeys)ÚselfÚkwargsÚkw©rú=/usr/lib/python3.9/site-packages/up2date_client/rhnChannel.pyÚ__init__s zrhnChannel.__init__cCs |j|Sr ©r )rÚitemrrrÚ __getitem__szrhnChannel.__getitem__cCs||j|<dSr r)rrÚvaluerrrÚ __setitem__szrhnChannel.__setitem__cCs|jd|jdkS)NÚnamer)rÚotherrrrÚ__lt__!szrhnChannel.__lt__cCs |j ¡Sr r ©rrrrr $szrhnChannel.keyscCs |j ¡Sr )r Úvaluesrrrrr'szrhnChannel.valuescCs |j ¡Sr )r Úitemsrrrrr*szrhnChannel.itemsN) Ú__name__Ú __module__Ú __qualname__rrrrr rrrrrrr sr c@s<eZdZdd„Zdd„Zdd„Zdd„Zd d „Zd d „Zd S)ÚrhnChannelListcCs g|_dSr ©Úlistrrrrr.szrhnChannelList.__init__cCs|j |¡dSr ©r$Úappend)rÚchannelrrrÚ addChannel3szrhnChannelList.addChannelcCs|jSr r#rrrrÚchannels7szrhnChannelList.channelscCs$|jD]}|d|kr|SqdS)NÚlabelr#)rÚ channelnamer'rrrÚ getByLabel:s  zrhnChannelList.getByLabelcCs | |¡Sr )r,)rr+rrrÚ getByName>szrhnChannelList.getByNamecCs*g}|jD]}|d|kr | |¡q |S)NÚtyper%)rr.r)r'rrrÚ getByTypeAs    zrhnChannelList.getByTypeN) rr r!rr(r)r,r-r/rrrrr"-s r"cCs`g}t|d}| ¡D]D}|ddkrP|d|d<d|d|d|df|d<| |¡q|S) N©Útimeoutr.Úup2dater*rz%s channel %s from %sÚurlÚ description)Ú getChannelsr)r&)r1r)ZsourceChannelsZ sourceChannelrrrÚgetChannelDetailsKs    þ  r6c Cs0t ¡}t ¡}ts|stƒatj|d}t  ¡sDt   t dƒ¡‚|j  t  ¡¡}|D]´}|rn|d|vrnqXtdt ¡d}| ¡D]&} | dkr |d|d<q†|| || <q†|dr|d|d <|d<|d <|d <| d |d ¡| d ¡| d¡t |¡qXttjƒdkr,t  t dƒ¡‚tS)zG return rhnChannelList containing list of channel we are subscribed to r0zUnable to Locate SystemIdr*r2)r.r3Z last_modifiedÚversionZchannelOverriderr4Zsummaryz'WARNING: Channel overridden locally: %sz=-------: If you see this warning outside of the leapp processz$-------: contact CloudLinux support.rzEThis system may not be updated until it is associated with a channel.)rZinitUp2dateConfigrZinitLogÚselected_channelsr"rÚ RhnServerrÚ getSystemIdrZNoSystemIdErrorÚ_r2Z listChannelsr ZgetServerlURLFromMirrorr Zlog_mer(Úlenr$ZNoChannelsError) ÚforceÚlabel_whitelistr1ZcfgÚlogÚsZup2dateChannelsZchanr'Úkeyrrrr5^s8    þ   r5cCs dattdd„|ƒƒ}t|dS)NcSs|dfS)Nér)ÚxrrrÚ‰ózsetChannels..)r>)r8r Úmapr5)Z tempchannelsZ whitelistrrrÚ setChannels†srGcCst ¡}|j t ¡|||¡Sr )rr9r2ÚsubscribeChannelsrr:©r)ÚusernameÚpasswdr@rrrrHŽsÿrHcCst ¡}|j t ¡|||¡Sr )rr9r2ÚunsubscribeChannelsrr:rIrrrrL“sÿrL)N)NNN)Zup2date_clientrrrrrÚgettextÚ translationÚtÚhasattrrr;r r"r6Z cmdline_pkgsr8r5rGrHrLrrrrÚs$        (