ó Afc@süddlZddlZddlZddlTddlZejjZeZej jZ d„Z ej dƒZ d„Zd„Zd„ZddlmZid d 6d d 6d d 6d d6dd6dd6dd6dd6Zd„Zedkrøe ƒndS(iÿÿÿÿN(t*cCsÍd}tjds<tdtjddƒtjdƒnx}tjdD]n}tjj|ƒrzt|ƒr¸d}q¸qJtjj|ƒr£t|dƒd}qJt |ƒrJd}qJqJWtj|ƒdS(Niisusage: s file-or-directory ... is": will not process symbolic links ( tsystargvterrtexittostpathtisdirt recursedowntislinktfix(tbadtarg((s*/usr/lib64/python2.7/Demo/scripts/eqfix.pytmain)s    s^[a-zA-Z0-9_]+\.py$cCstj|ƒdkS(Ni(t ispythonprogtmatch(tname((s*/usr/lib64/python2.7/Demo/scripts/eqfix.pytispython9scCs1td|fƒd}ytj|ƒ}Wn+tjk rW}td||fƒdSX|jƒg}xœ|D]”}|tjtjfkr“qontjj ||ƒ}tjj |ƒr½qotjj |ƒrß|j |ƒqot |ƒrot|ƒrd}qqoqoWx#|D]}t|ƒrd}qqW|S(Nsrecursedown(%r) is%s: cannot list directory: %r i(tdbgRtlistdirterrorRtsorttcurdirtpardirRtjoinR RtappendRR R(tdirnameR tnamestmsgtsubdirsRtfullname((s*/usr/lib64/python2.7/Demo/scripts/eqfix.pyR<s0      c Cs„yt|dƒ}Wn(tk r=}td||fƒdSXtjj|ƒ\}}tjj|d|ƒ}d}d}x|jƒ}|s”Pn|d}|dkrÒd|krÒt|dƒ|j ƒdS|dkrf|dkrf|d d krft j|dƒ} | rft j d | dƒdkrf|d | d}|d }t|ƒ|j ƒdSnx>|d dkr¦|jƒ} | sPn|| }|d}qiWt |ƒ} | |krm|dkr:yt|dƒ}Wn2tk r}|j ƒtd||fƒdSX|jdƒd}t|dƒq~ntt|ƒdƒtd|ƒtd| ƒn|dk r~|j| ƒq~q~W|j ƒ|s¡dSy+tj|ƒ} tj|| td@ƒWn*tjk rø}td||fƒnXytj||dƒWn*tjk r=}td||fƒnXytj||ƒWn+tjk r}td||fƒdSXdS(Ntrs%s: cannot open: %r it@iss!: contains null bytes; not fixed is#!s [pP]ythons: s script; not fixed iþÿÿÿs\ tws%s: cannot create: %r s: s s< s> iÿs%s: warning: chmod failed (%r) t~s %s: warning: backup failed (%r) s%s: rename failed (%r) (topentIOErrorRRRtsplitRtNonetreadlinetclosetstringtretsearchtfixlinetseektreptreprtwritetstattchmodtST_MODERtrename( tfilenametfRtheadttailttempnametgtlinenotlinetwordstnextlinetnewlinetstatbuf((s*/usr/lib64/python2.7/Demo/scripts/eqfix.pyR Rsˆ   ("            (t tokenprogt:tifteliftwhiles treturnt)t(t]t[t}t{t`cCs?d|kr|Sdt|ƒ}}g}x||kr:tj||ƒ}|dkrcdGH|G|Stjd\}}|||!}||}|r­||dkr­|d=q,tj|ƒrÐ|jt|ƒq,|dkr|r|| d||}|tdƒt|ƒ}}q,|dkr,| r,dGH|Gq,q,W|S(Nt=is(Syntax error:)iiÿÿÿÿs==s(Warning: '==' at top level:)(tlenRARtregsthas_keyR(R<titntstacktjtatbttoken((s*/usr/lib64/python2.7/Demo/scripts/eqfix.pyR,©s0       t__main__(RR*RR1R)tstderrR0RRtstdoutR.R tcompileRRRR ttokenizeRARR,t__name__(((s*/usr/lib64/python2.7/Demo/scripts/eqfix.pyts$           R