V Qc@sdZddlZddlZddlZddlZddlZddlZddlZdd dYZdej efdYZ de ej fdYZ d Z d Zed krendS( sRCS Proxy. Provide a simplified interface on RCS files, locally or remotely. The functionality is geared towards implementing some sort of remote CVS like utility. It is modeled after the similar module FSProxy. The module defines two classes: RCSProxyLocal -- used for local access RCSProxyServer -- used on the server side of remote access The corresponding client class, RCSProxyClient, is defined in module rcsclient. The remote classes are instantiated with an IP address and an optional verbosity flag. iNt DirSupportcBseeZdZdZdZdZdZdZd dZ dZ dZ d Z RS( cCs g|_dS(N(t _dirstack(tself((s+/usr/lib64/python2.7/Demo/pdist/RCSProxy.pyt__init__!scCs|jdS(N(t_close(R((s+/usr/lib64/python2.7/Demo/pdist/RCSProxy.pyt__del__$scCsx|jr|jqWdS(N(Rtback(R((s+/usr/lib64/python2.7/Demo/pdist/RCSProxy.pyR's cCs tjS(N(tostgetcwd(R((s+/usr/lib64/python2.7/Demo/pdist/RCSProxy.pytpwd+scCs-tj}tj||jj|dS(N(RRtchdirRtappend(Rtnametsave((s+/usr/lib64/python2.7/Demo/pdist/RCSProxy.pytcd.s  cCs@|jstjdn|jd}tj||jd=dS(Nsempty directory stacki(RRterrorR (Rtdir((s+/usr/lib64/python2.7/Demo/pdist/RCSProxy.pyR3s    cCs7tjtj}ttjj|}|j||S(N(Rtlistdirtcurdirtfiltertpathtisdirt_filter(Rtpattfiles((s+/usr/lib64/python2.7/Demo/pdist/RCSProxy.pyt listsubdirs:scCstjj|S(N(RRR(RR ((s+/usr/lib64/python2.7/Demo/pdist/RCSProxy.pyR?scCstj|ddS(Ni(Rtmkdir(RR ((s+/usr/lib64/python2.7/Demo/pdist/RCSProxy.pyRBscCstj|dS(N(Rtrmdir(RR ((s+/usr/lib64/python2.7/Demo/pdist/RCSProxy.pyREsN( t__name__t __module__RRRR RRtNoneRRRR(((s+/usr/lib64/python2.7/Demo/pdist/RCSProxy.pyRs         t RCSProxyLocalcBsheZdZdZd dZd dZdZdZd dZ d dZ d dZ RS( cCs!tjj|tj|dS(N(trcslibtRCSRR(R((s+/usr/lib64/python2.7/Demo/pdist/RCSProxy.pyRKscCs!tj|tjj|dS(N(RRR R!(R((s+/usr/lib64/python2.7/Demo/pdist/RCSProxy.pyROs cCs|j|j|S(N(t_listtsum(Rtlist((s+/usr/lib64/python2.7/Demo/pdist/RCSProxy.pytsumlistSscCs|j|j|S(N(t_dictR#(RR$((s+/usr/lib64/python2.7/Demo/pdist/RCSProxy.pytsumdictVscCsd|j|}d}tj}x)|j|}|s=Pn|j|q$|j||jS(Niii (t_opentmd5tnewtreadtupdatet _closepipetdigest(Rtname_revtft BUFFERSIZER#tbuffer((s+/usr/lib64/python2.7/Demo/pdist/RCSProxy.pyR#Ys  cCs,|j|}|j}|j||S(N(R(R+R-(RR/R0tdata((s+/usr/lib64/python2.7/Demo/pdist/RCSProxy.pytgetes  cCs\|j|\}}t|d}|j||j|j|||j|dS(Ntw(t _unmangletopentwritetclosetcheckint_remove(RR/R3tmessageR trevR0((s+/usr/lib64/python2.7/Demo/pdist/RCSProxy.pytputks   cCs|dkr|j}ng}x[|D]S}y|j|||fWq(tjtfk rz|j|dfq(Xq(W|S(sINTERNAL: apply FUNCTION to all files in LIST. Return a list of the results. The list defaults to all files in the directory if None. N(Rt listfilesR RRtIOError(RtfunctionR$tresR ((s+/usr/lib64/python2.7/Demo/pdist/RCSProxy.pyR"ss  cCsg|dkr|j}ni}x?|D]7}y||||R"R&(((s+/usr/lib64/python2.7/Demo/pdist/RCSProxy.pyRIs       tRCSProxyServercBs)eZejdZdZdZRS(cCs'tj|tjj|||dS(N(RRtservert SecureServer(Rtaddresstverbose((s+/usr/lib64/python2.7/Demo/pdist/RCSProxy.pyRs cCs!tjj|tj|dS(N(RERFRR(R((s+/usr/lib64/python2.7/Demo/pdist/RCSProxy.pyRscCs.tjj|x|jr)|jqWdS(N(RERFt_serveRR(R((s+/usr/lib64/python2.7/Demo/pdist/RCSProxy.pyRIs (RRREtVERBOSERRRI(((s+/usr/lib64/python2.7/Demo/pdist/RCSProxy.pyRDs cCsdddl}ddl}|jdr>|j|jd}nd}td|f}|jdS(Niiit(tstringtsystargvtatoiRDt _serverloop(RLRMtporttproxy((s+/usr/lib64/python2.7/Demo/pdist/RCSProxy.pyt test_servers   cCsddl}|jd s>|jdrU|jdddkrUt|jdnt}|jd}t||rt||}t|rt|t |jdGHqt |GHnd|GH|jddS(Niiit 0123456789is%s: no such attribute( RMRNRStexitRthasattrtgetattrtcallabletapplyttupletrepr(RMRRtwhattattr((s+/usr/lib64/python2.7/Demo/pdist/RCSProxy.pyttests 2    t__main__((t__doc__RER)RtfnmatchRLttempfileR RR!RRFRDRSR^R(((s+/usr/lib64/python2.7/Demo/pdist/RCSProxy.pyts       *O