ROOTPLOIT
Server: LiteSpeed
System: Linux server71.web-hosting.com 4.18.0-513.18.1.lve.el8.x86_64 #1 SMP Thu Feb 22 12:55:50 UTC 2024 x86_64
User: niphet (1079)
PHP: 5.3.29
Disabled: NONE
Upload Files
File: //lib/python3.6/site-packages/dnf/__pycache__/persistor.cpython-36.opt-1.pyc
3

ft`o@sddlmZddlmZddlmZddlZddlZddl	Z	ddl
Z
ddlZddlZddl
Z
ddlZejdZGdddeZGdd	d	eZGd
ddeZdS))absolute_import)unicode_literals)_Ndnfc@s,eZdZddZgfddZeddZdS)JSONDBcCs0tjj|s,tjjtjj||j|gdS)N)ospathisfilerutilZ
ensure_dirdirname_write_json_db)self	json_pathr/usr/lib/python3.6/persistor.py_check_json_db+szJSONDB._check_json_dbcCst|d}|j}WdQRX|dkrDtjtd||j||n<ytj|}Wn,tk
r~}ztj|WYdd}~XnX|S)Nrz%s is empty file)	openreadloggerwarningrrjsonloads
ValueError)r
rdefaultfcontenterrr_get_json_db1szJSONDB._get_json_dbc
Cs&t|d}tj||WdQRXdS)Nw)rrdump)rrrrrrr?szJSONDB._write_json_dbN)__name__
__module____qualname__rrstaticmethodrrrrrr)src@s<eZdZdZddZeddZddZdd	Zd
dZ	dS)

RepoPersistorzePersistent data kept for repositories.

    Is arch/releasever specific and stores to cachedir.

    cCs*||_tjj|jd|_t|_d|_dS)Nzexpired_repos.jsonF)cachedirrrjoindb_pathsetexpired_to_addreset_last_makecache)r
r'rrr__init__LszRepoPersistor.__init__cCstjj|jdS)NZlast_makecache)rrr(r')r
rrr_last_makecache_pathRsz"RepoPersistor._last_makecache_pathcCsRy|j|jt|j|jStk
rL}ztjtd|dSd}~XnXdS)Nz&Failed to load expired repos cache: %s)rr)r*rOSErrorrrr)r
rrrrget_expired_reposVszRepoPersistor.get_expired_reposcCsy$|j|j|j|jt|jWn0tk
rT}ztjtd|dSd}~XnX|j	ryt
jj|j
dStk
rtjtddSXdS)Nz'Failed to store expired repos cache: %sFTz#Failed storing last makecache time.)rr)rlistr+r/rrrr,rr
Ztouchr.IOError)r
rrrrsave^szRepoPersistor.savecCs:yttjj|jStk
r4tjtddSXdS)Nz'Failed determining last makecache time.)	intrr
Zfile_ager.r/rrr)r
rrrsince_last_makecachems
z"RepoPersistor.since_last_makecacheN)
r"r#r$__doc__r-propertyr.r0r3r5rrrrr&Esr&c@s,eZdZddZddZddZddZd	S)
TempfilePersistorcCs"tjj|d|_t|_d|_dS)Nztempfiles.jsonF)rrr(r)r*tempfiles_to_add_empty)r
r'rrrr-wszTempfilePersistor.__init__cCs|j|j|j|jS)N)rr)r)r
rrrget_saved_tempfiles|sz%TempfilePersistor.get_saved_tempfilescCsp|jr|jrdS|j|j|jr8|j|jgdS|jrlt|j|j}|j|j|j|jt|dS)N)	r:r9rr)rr*rupdater1)r
datarrrr3szTempfilePersistor.savecCs
d|_dS)NT)r:)r
rrremptyszTempfilePersistor.emptyN)r"r#r$r-r;r3r>rrrrr8usr8)Z
__future__rrZdnf.i18nrZdistutils.versionZ	distutilsZdnf.utilrerrnoZfnmatchrZloggingrreZ	getLoggerrobjectrr&r8rrrr<module>s
0