Ñò zsKc@s+ddkZd„Zd„Zd„ZdS(iÿÿÿÿNcCs:tii|ƒ}tii|ƒpti|ƒndS(N(tostpathtdirnametexiststmakedirs(tftd((s ./cache.pyt ensure_dir scCs“y…tt|ƒdƒ}tt|ƒddƒ}tt|ƒdƒ}td|||f}tii|ƒoti|ƒnWnnXdS(Ni idiès/idcache/%s/%s/%s.html(tstrtlongRRRtremove(tidtl1tl2tl3t cachefile((s ./cache.pyt clear_idcachesc Cs%|pdSx|D] }yúdG|GHtidƒid|ƒ}|iddƒ}ttdƒttd|dƒttd|d|d d !fƒtd |d|d d !f|}tii|ƒ ptii|ƒdjo)t |d ƒi t i |ƒi ƒƒnWqqXqWdS( Nt ___cachings http://[^/]*tt/s /imgcache/1s/imgcache/%s/1is/imgcache/%s/%s/1iis/imgcache/%s/%s/tw(tretcompiletsubtreplaceRRRRtgetsizetopentwriteturllibturlopentread(tlinkstlR((s ./cache.pyt cache_images  ##--(RRRR!(((s ./cache.pyt s