ÿØÿà JFIF      ÿÛ „ 	 ( %!1!%)+//.383,7(-.+



-%%-////---/-.+/--+------/------/--0+--/-/-----.-----ÿÀ  ¥2" ÿÄ               ÿÄ J  	     ! 1AQ"aq2‘#BR‚¡ÁÑ3br’¢±Âð$CSƒ²á4c“%DsÓñÿÄ              ÿÄ *        !1AQa‘"2q3±ð#b¡ÿÚ   ? ¼QxJQaÍuò¸Zö Úü8,ÐÚú
"SSn<rçù–´âE—^ªBÖ9À\†¸ÔÁT­ÃÛ5
ëd´³Í#Ý;Þ38œî ¶H£M:wÎ3…³…âpÔF&‚FK¸9„â4àGEõªfÿ ‘ñ(ßw­pŽF|È¥ù®häðÍÑ¶¹‘[ÒinÙW¶ùñY˜Q{›K"išÒ[Ú8žë\F¹@-?v"ÔU”,ìöžkÿ {I‡£šÍ?e
ríV
..............................................................................................................................................................................
.............................................................................                                                  
                                                                                                                                                                                     ÿØÿà JFIF      ÿÛ „ 	 ( %!1!%)+//.383,7(-.+



-%%-////---/-.+/--+------/------/--0+--/-/-----.-----ÿÀ  ¥2" ÿÄ               ÿÄ J  	     ! 1AQ"aq2‘#BR‚¡ÁÑ3br’¢±Âð$CSƒ²á4c“%DsÓñÿÄ              ÿÄ *        !1AQa‘"2q3±ð#b¡ÿÚ   ? ¼QxJQaÍuò¸Zö Úü8,ÐÚú
"SSn<rçù–´âE—^ªBÖ9À\†¸ÔÁT­ÃÛ5
ëd´³Í#Ý;Þ38œî ¶H£M:wÎ3…³…âpÔF&‚FK¸9„â4àGEõªfÿ ‘ñ(ßw­pŽF|È¥ù®häðÍÑ¶¹‘[ÒinÙW¶ùñY˜Q{›K"išÒ[Ú8žë\F¹@-?v"ÔU”,ìöžkÿ {I‡£šÍ?e
ríV
..............................................................................................................................................................................
.............................................................................                                                  
                                                                                                                                                                                     3
g&                 @   s`   d dl mZ d dlmZ d dlmZ d dlZd dlZ	d dl
Z
d dlZejjZG dd deZdS )    )unicode_literals)ConfigError)_Nc                   s   e Zd Zdd Zdd Zdd Zdd Zf fd	d
Zdd Zdd Z	dd Z
dd Z fddZdd Zdd Zdd Z  ZS )RepoDictc             C   sj   |j }|| krd}t|| y|jj  W n0 tk
r\ } ztdj|W Y d d }~X nX || |< d S )Nz;Repository %s is listed more than once in the configurationz{0})idr   Z_repoZverifyRuntimeErrorformat)selfrepoZid_msge r   /usr/lib/python3.6/repodict.pyadd#   s     zRepoDict.addc             C   s   t jj| j S )N)dnfutilMultiCallListvalues)r	   r   r   r   all/   s    zRepoDict.allc             C   s   t jj| j  S )N)r   r   emptyiter_enabled)r	   r   r   r   _any_enabled3   s    zRepoDict._any_enabledc             C   sP   xJ| j  D ]>}x8| j||jD ]$}|js tjtd|j |j  q W q
W d S )Nzenabling %s repository)r   get_matchingr   enabledloggerinfor   enable)r	   Zsub_name_fnr
   foundr   r   r   _enable_sub_repos6   s
    zRepoDict._enable_sub_reposc       
         s    fdd}t jj| }x:|D ]2}d|kr>djtjj|}| j||g7  _q W x$|j D ]\}}	t	||||	 q`W | j
| tjtd|dj| |S )a  
        Creates new repo object and add it into RepoDict. Variables in provided values will be
        automatically substituted using conf.substitutions (like $releasever, ...)

        @param repoid: Repo ID - string
        @param conf: dnf Base().conf object
        @param baseurl: List of strings
        @param kwargs: keys and values that will be used to setattr on dnf.repo.Repo() object
        @return: dnf.repo.Repo() object
        c                sp   t | trtjjj|  jS t | ts0t | trlg }x.| D ]&}t |tr:|j	tjjj| j q:W |rl|S | S )N)

isinstancestrlibdnfconfZConfigParser
substituteZsubstitutionslisttupleappend)r   Zsubstitutedvalue)r"   r   r   r#   I   s    


z)RepoDict.add_new_repo.<locals>.substitutez://z	file://{}zAdded %s repo from %sz, )r   r
   ZRepor   ospathabspathbaseurlitemssetattrr   r   r   r   join)
r	   Zrepoidr"   r+   kwargsr#   r
   r)   keyr'   r   )r"   r   add_new_repo=   s    

zRepoDict.add_new_repoc             C   s   dd }| j | dS )z@enable debug repos corresponding to already enabled binary reposc             S   s&   | j drdj| d d S dj| S )Nz-rpmsz{}-debug-rpms   z{}-debuginfo)endswithr   )namer   r   r   
debug_namee   s    z/RepoDict.enable_debug_repos.<locals>.debug_nameN)r   )r	   r6   r   r   r   enable_debug_reposa   s    zRepoDict.enable_debug_reposc             C   s   dd }| j | dS )zAenable source repos corresponding to already enabled binary reposc             S   s&   | j drdj| d d S dj| S )Nz-rpmsz{}-source-rpmsr2   z	{}-sourcer3   )r4   r   )r5   r   r   r   source_nameo   s    z1RepoDict.enable_source_repos.<locals>.source_nameN)r   )r	   r8   r   r   r   enable_source_reposk   s    zRepoDict.enable_source_reposc                sZ   t jj r, fddD }t jj|S j d }|d krLt jjg S t jj|gS )Nc                s    g | ]}t j | r| qS r   )fnmatch).0k)r0   r	   r   r   
<listcomp>x   s    z)RepoDict.get_matching.<locals>.<listcomp>)r   r   Zis_glob_patternr   get)r	   r0   lr
   r   )r0   r	   r   r   u   s    zRepoDict.get_matchingc             C   s   dd | j  D S )Nc             s   s   | ]}|j r|V  qd S )N)r   )r;   rr   r   r   	<genexpr>   s    z(RepoDict.iter_enabled.<locals>.<genexpr>)r   )r	   r   r   r   r      s    zRepoDict.iter_enabledc                s$   dd t tt| j dd dD S )zreturn repos sorted by priorityc             s   s   | ]
}|V  qd S )Nr   )r;   itemr   r   r   rA      s    z!RepoDict.items.<locals>.<genexpr>c             S   s   | d j | d jfS )N   )ZpriorityZcost)xr   r   r   <lambda>   s    z RepoDict.items.<locals>.<lambda>)r0   )sortedsuperr   r,   )r	   )	__class__r   r   r,      s    zRepoDict.itemsc             C   s   | j  S )N)keys)r	   r   r   r   __iter__   s    zRepoDict.__iter__c             C   s   dd | j  D S )Nc             s   s   | ]\}}|V  qd S )Nr   )r;   r<   vr   r   r   rA      s    z RepoDict.keys.<locals>.<genexpr>)r,   )r	   r   r   r   rI      s    zRepoDict.keysc             C   s   dd | j  D S )Nc             s   s   | ]\}}|V  qd S )Nr   )r;   r<   rK   r   r   r   rA      s    z"RepoDict.values.<locals>.<genexpr>)r,   )r	   r   r   r   r      s    zRepoDict.values)__name__
__module____qualname__r   r   r   r   r1   r7   r9   r   r   r,   rJ   rI   r   __classcell__r   r   )rH   r   r   !   s   $


r   )Z
__future__r   Zdnf.exceptionsr   Zdnf.i18nr   Zdnf.utilr   Zlibdnf.confr!   r:   r(   r   r   dictr   r   r   r   r   <module>   s   