7ec@sddlZddlZddlZddlTejjZeZejjZ dZ ej dZ dZ dZdZdZej eZd Zed kre ndS( iN(t*cCsd}tjds<tdtjddtjdnx}tjdD]n}tjj|rzt|rd}qqJtjj|rt|dd}qJt |rJd}qJqJWtj|dS(Niisusage: s file-or-directory ... is": will not process symbolic links ( tsystargvterrtexittostpathtisdirt recursedowntislinktfix(tbadtarg((s-/usr/lib64/python2.7/Tools/scripts/methfix.pytmain&s    s^[a-zA-Z0-9_]+\.py$cCstj|dkS(Ni(t ispythonprogtmatch(tname((s-/usr/lib64/python2.7/Tools/scripts/methfix.pytispython6scCs1td|fd}ytj|}Wn+tjk rW}td||fdSX|jg}x|D]}|tjtjfkrqontjj ||}tjj |rqotjj |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/Tools/scripts/methfix.pyR9s0      c Csyt|d}Wn(tk r=}td||fdSXtjj|\}}tjj|d|}d}d}x |j}|sPn|d}|dkrd|krt|d|j dS|dkrc|dkrc|d d krc|dj} | rct j d | ddkrc|d | d}|d }t||j dSnx>|d dkr|j} | sPn|| }|d}qfWt |} | |krj|dkr7yt|d}Wn2tk r}|j td||fdSX|j dd}t|dq~ntt|dtd|td| n|dk r~|j| q~q~W|j |sdSy+tj|} tj|| td@Wn*tjk r}td||fnXytj||dWn*tjk r:}td||fnXytj||Wn+tjk r|}td||fdSXdS(Ntrs%s: cannot open: %r it@iss!: contains null bytes; not fixed is#!s [pP]ythons: s script; not fixed is\ tws%s: cannot create: %r s: s s< s> is%s: warning: chmod failed (%r) t~s %s: warning: backup failed (%r) s%s: rename failed (%r) (topentIOErrorRRRtsplitRtNonetreadlinetclosetretsearchtfixlinetseektreptreprtwritetstattchmodtST_MODERtrename( tfilenametfRtheadttailttempnametgtlinenotlinetwordstnextlinetnewlinetstatbuf((s-/usr/lib64/python2.7/Tools/scripts/methfix.pyR Os   ("            s8^[ ]+def +[a-zA-Z0-9_]+ *( *self *, *(( *(.*) *)) *) *:cCs[tj|dkrWtjdd!\\}}\}}|| |||!||}n|S(Niii(tfixprogRtregs(R;tatbtctd((s-/usr/lib64/python2.7/Tools/scripts/methfix.pyR+s" t__main__(RR)RR0tstderrR/RRtstdoutR-R tcompileRRRR tfixpatR@R+t__name__(((s-/usr/lib64/python2.7/Tools/scripts/methfix.pyts          R