σ /ˆΑZc@`s ddlmZddlmZddlmZddlmZddlZddlZddlZddlZddl Z ddl Z ddl Z yddl Z Wnek rΓddl Z nXddlZddlmZdZd „Zd efd „ƒYZdS( i(tabsolute_import(tdivision(tprint_function(tunicode_literalsNi(tutilsu.cache-versioncC`s|tjjtjƒ}tjtjj|dƒƒ}|jtj dƒd„|Dƒ}t j dj|ƒj dƒƒj ƒS(Nu*.pyics`s'|]}ttj|ƒjƒVqdS(N(tstrtoststattst_mtime(t.0tsource((sn/home/vagrant/ruby-gnome2/gobject-introspection/vendor/local/lib/gobject-introspection/giscanner/cachestore.pys 4suuascii(Rtpathtdirnamet giscannert__file__tglobtjointappendtsystargvthashlibtsha1tencodet hexdigest(ttopleveltsourcestmtimes((sn/home/vagrant/ruby-gnome2/gobject-introspection/vendor/local/lib/gobject-introspection/giscanner/cachestore.pyt_get_versionhash/s t CacheStorecB`sYeZd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Z d„Z RS( cC`s|jƒ|_|jƒdS(N(t _get_cachedirt _directoryt_check_cache_version(tself((sn/home/vagrant/ruby-gnome2/gobject-introspection/vendor/local/lib/gobject-introspection/giscanner/cachestore.pyt__init__;scC`s*dtjkrdStjdƒ}|SdS(NuGI_SCANNER_DISABLE_CACHEu g-ir-scanner(RtenvirontNoneRtget_user_cache_dir(R tcachedir((sn/home/vagrant/ruby-gnome2/gobject-introspection/vendor/local/lib/gobject-introspection/giscanner/cachestore.pyR?sc C`s=|jdkrdStƒ}tjj|jtƒ}y(t|dƒ}|jƒ}WdQXWn7t t fk r•}|j t j krd}q–‚nX||kr¦dS|j ƒtjddƒ\}}y<tj|dƒ}|j|ƒWdQXtj||ƒWn2t t fk r8}|j t jkr2dS‚nXdS(Nuritprefixug-ir-scanner-cache-version-uw(RR#RRR Rt_CACHE_VERSION_FILENAMEtopentreadtIOErrortOSErrorterrnotENOENTt_cleanttempfiletmkstemptfdopentwritetshutiltmovetEACCES( R t current_hashtversiont version_filet cache_hashtettmp_fdt tmp_filenamettmp_file((sn/home/vagrant/ruby-gnome2/gobject-introspection/vendor/local/lib/gobject-introspection/giscanner/cachestore.pyRFs.    cC`sG|jdkrdStj|jdƒƒjƒ}tjj|j|ƒS(Nuutf-8( RR#RRRRRR R(R tfilenameR((sn/home/vagrant/ruby-gnome2/gobject-introspection/vendor/local/lib/gobject-introspection/giscanner/cachestore.pyt _get_filenamejscC`s"tj|ƒjtj|ƒjkS(N(RRR(R tstore_filenameR>((sn/home/vagrant/ruby-gnome2/gobject-introspection/vendor/local/lib/gobject-introspection/giscanner/cachestore.pyt_cache_is_validuscC`sSytj|ƒWn;ttfk rN}|jtjtjfkrHdS‚nXdS(N(RtunlinkR*R+R,R5R-(R R>R:((sn/home/vagrant/ruby-gnome2/gobject-introspection/vendor/local/lib/gobject-introspection/giscanner/cachestore.pyt_remove_filenameys cC`sRxKtj|jƒD]7}|tkr+qn|jtjj|j|ƒƒqWdS(N(RtlistdirRR'RCR R(R R>((sn/home/vagrant/ruby-gnome2/gobject-introspection/vendor/local/lib/gobject-introspection/giscanner/cachestore.pyR.ƒs cC`s)|j|ƒ}|dkrdStjj|ƒrG|j||ƒrGdStjddƒ\}}y/tj|dƒ}t j ||ƒWdQXWn?t t fk rΟ}|j t jkrΙ|j|ƒdS‚nXytj||ƒWn>t t fk r$}|j t jkr|j|ƒq%‚nXdS(NR&ug-ir-scanner-cache-uwb(R?R#RR texistsRAR/R0R1tpickletdumpR*R+R,tENOSPCRCR3R4R5(R R>tdataR@R;R<R=R:((sn/home/vagrant/ruby-gnome2/gobject-introspection/vendor/local/lib/gobject-introspection/giscanner/cachestore.pytstore‰s( $ cC`sΚ|j|ƒ}|dkrdSyt|dƒ}Wn2ttfk rf}|jtjkr`dS‚nX|j||ƒs}dSytj |ƒ}Wn3t t t tj fk rΕ|j|ƒd}nX|S(Nurb(R?R#R(R*R+R,R-RARFtloadtAttributeErrortEOFErrort ValueErrort BadPickleGetRC(R R>R@tfdR:RI((sn/home/vagrant/ruby-gnome2/gobject-introspection/vendor/local/lib/gobject-introspection/giscanner/cachestore.pyRK¦s"   ( t__name__t __module__R!RRR?RARCR.RJRK(((sn/home/vagrant/ruby-gnome2/gobject-introspection/vendor/local/lib/gobject-introspection/giscanner/cachestore.pyR9s   $   (t __future__RRRRR,RRRR3RR/tcPickleRFt ImportErrorR tRR'RtobjectR(((sn/home/vagrant/ruby-gnome2/gobject-introspection/vendor/local/lib/gobject-introspection/giscanner/cachestore.pyts&