ÿØÿà 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
ft`o                 @   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
d dlZd dlZd dlZd dlZejdZG dd deZG dd	 d	eZG d
d deZdS )    )absolute_import)unicode_literals)_Ndnfc               @   s,   e Zd Zdd Zg fddZedd ZdS )JSONDBc             C   s0   t jj|s,tjjt jj| | j|g  d S )N)ospathisfiler   utilZ
ensure_dirdirname_write_json_db)self	json_path r   /usr/lib/python3.6/persistor.py_check_json_db+   s    zJSONDB._check_json_dbc             C   s   t |d}|j }W d Q R X |dkrDtjtd| | j|| n<ytj|}W n, tk
r~ } ztj| W Y d d }~X nX |S )Nr z%s is empty file)	openreadloggerwarningr   r   jsonloads
ValueError)r   r   defaultfcontenter   r   r   _get_json_db1   s    zJSONDB._get_json_dbc          
   C   s&   t | d}tj|| W d Q R X d S )Nw)r   r   dump)r   r   r   r   r   r   r   ?   s    zJSONDB._write_json_dbN)__name__
__module____qualname__r   r   staticmethodr   r   r   r   r   r   )   s   r   c               @   s<   e Zd ZdZdd Zedd Zdd Zdd	 Zd
d Z	dS )RepoPersistorzePersistent data kept for repositories.

    Is arch/releasever specific and stores to cachedir.

    c             C   s*   || _ tjj| j d| _t | _d| _d S )Nzexpired_repos.jsonF)cachedirr   r   joindb_pathsetexpired_to_addreset_last_makecache)r   r'   r   r   r   __init__L   s    zRepoPersistor.__init__c             C   s   t jj| jdS )NZlast_makecache)r   r   r(   r'   )r   r   r   r   _last_makecache_pathR   s    z"RepoPersistor._last_makecache_pathc             C   sR   y| j | j t| j| jS  tk
rL } ztjtd| d S d }~X nX d S )Nz&Failed to load expired repos cache: %s)r   r)   r*   r   OSErrorr   r   r   )r   r   r   r   r   get_expired_reposV   s    zRepoPersistor.get_expired_reposc             C   s   y$| j | j | j| jt| j W n0 tk
rT } ztjtd| dS d }~X nX | j	ryt
jj| j dS  tk
r   tjtd dS X d S )Nz'Failed to store expired repos cache: %sFTz#Failed storing last makecache time.)r   r)   r   listr+   r/   r   r   r   r,   r   r
   Ztouchr.   IOError)r   r   r   r   r   save^   s    zRepoPersistor.savec             C   s:   yt tjj| jS  tk
r4   tjtd d S X d S )Nz'Failed determining last makecache time.)	intr   r
   Zfile_ager.   r/   r   r   r   )r   r   r   r   since_last_makecachem   s
    z"RepoPersistor.since_last_makecacheN)
r"   r#   r$   __doc__r-   propertyr.   r0   r3   r5   r   r   r   r   r&   E   s   r&   c               @   s,   e Zd Zdd Zdd Zdd Zdd Zd	S )
TempfilePersistorc             C   s"   t jj|d| _t | _d| _d S )Nztempfiles.jsonF)r   r   r(   r)   r*   tempfiles_to_add_empty)r   r'   r   r   r   r-   w   s    zTempfilePersistor.__init__c             C   s   | j | j | j| jS )N)r   r)   r   )r   r   r   r   get_saved_tempfiles|   s    z%TempfilePersistor.get_saved_tempfilesc             C   sp   | j  r| j rd S | j| j | j r8| j| jg  d S | jrlt| j| j}|j| j | j| jt| d S )N)	r:   r9   r   r)   r   r*   r   updater1   )r   datar   r   r   r3      s    zTempfilePersistor.savec             C   s
   d| _ d S )NT)r:   )r   r   r   r   empty   s    zTempfilePersistor.emptyN)r"   r#   r$   r-   r;   r3   r>   r   r   r   r   r8   u   s   r8   )Z
__future__r   r   Zdnf.i18nr   Zdistutils.versionZ	distutilsZdnf.utilr   errnoZfnmatchr   Zloggingr   reZ	getLoggerr   objectr   r&   r8   r   r   r   r   <module>   s   
0