ó 6šâWc@s2ddlZddlZdefd„ƒYZdS(iÿÿÿÿNt SmartFilecBsGeZdZdd„Zd„Zd„Zd„Zd„Zd„ZRS(sß A file-like object used for writing files. The given file will only be actually written to disk if there's not a file with the same name, or if the existing file is *different* from the file to be written. twcCs(||_||_g|_t|_dS(N(tfilenametmodet _contentstFalset_closed(tselfRR((s3/usr/lib/python2.7/dist-packages/Pyste/SmartFile.pyt__init__s   cCs|js|jƒndS(N(Rtclose(R((s3/usr/lib/python2.7/dist-packages/Pyste/SmartFile.pyt__del__s cCs|jj|ƒdS(N(Rtappend(Rtstring((s3/usr/lib/python2.7/dist-packages/Pyste/SmartFile.pytwritescCs0t|j|jƒ}|j|ƒ|jƒdS(N(tfileRRR R (Rtcontentstf((s3/usr/lib/python2.7/dist-packages/Pyste/SmartFile.pyt_dowrite#s cCstj|ƒjƒS(N(tmd5tnewtdigest(RR ((s3/usr/lib/python2.7/dist-packages/Pyste/SmartFile.pyt_GetMD5)scCs£dj|jƒ}tjj|jƒs7|j|ƒn_t|jƒ}|jƒ}|j ƒ|j |ƒ}|j |ƒ}||kr–|j|ƒnt |_ dS(Nt( tjoinRtostpathtisfileRRRtreadR RtTrueR(Rt this_contentsRtother_contentstthis_md5t other_md5((s3/usr/lib/python2.7/dist-packages/Pyste/SmartFile.pyR -s   ( t__name__t __module__t__doc__RR R RRR (((s3/usr/lib/python2.7/dist-packages/Pyste/SmartFile.pyR s     (RRtobjectR(((s3/usr/lib/python2.7/dist-packages/Pyste/SmartFile.pyts