ó Afc@sÑdZddlZddlZddlZddlZddlZddlZddlZdd d„ƒYZdej efd„ƒYZ de ej fd„ƒYZ d „Z d „Zed krÍeƒndS( 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. iÿÿÿÿNt DirSupportcBseeZd„Zd„Zd„Zd„Zd„Zd„Zd d„Z d„Z d„Z d „Z RS( cCs g|_dS(N(t _dirstack(tself((s+/usr/lib64/python2.7/Demo/pdist/RCSProxy.pyt__init__!scCs|jƒdS(N(t_close(R((s+/usr/lib64/python2.7/Demo/pdist/RCSProxy.pyt__del__$scCsx|jr|jƒqWdS(N(Rtback(R((s+/usr/lib64/python2.7/Demo/pdist/RCSProxy.pyR's cCs tjƒS(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@|jstjd‚n|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|dƒdS(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 RCSProxyLocalcBsheZd„Zd„Zd d„Zd d„Zd„Zd„Zd d„Z d d„Z d d„Z 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.pytsumdictVscCse|j|ƒ}d}tjƒ}x*|j|ƒ}|s=Pn|j|ƒq$W|j|ƒ|jƒS(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|||ƒfƒWq(tjtfk rz|j|dfƒq(Xq(W|S(s¡INTERNAL: 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)eZejd„Zd„Zd„ZRS(cCs'tj|ƒtjj|||ƒdS(N(RRtservert SecureServer(Rtaddresstverbose((s+/usr/lib64/python2.7/Demo/pdist/RCSProxy.pyRšs cCs!tjj|ƒtj|ƒdS(N(RERFRR(R((s+/usr/lib64/python2.7/Demo/pdist/RCSProxy.pyRžscCs.tjj|ƒx|jr)|jƒqWdS(N(RERFt_serveRR(R((s+/usr/lib64/python2.7/Demo/pdist/RCSProxy.pyRI¢s (RRREtVERBOSERRRI(((s+/usr/lib64/python2.7/Demo/pdist/RCSProxy.pyRD˜s cCsdddl}ddl}|jdr>|j|jdƒ}nd}td|fƒ}|jƒdS(Niÿÿÿÿiit(tstringtsystargvtatoiRDt _serverloop(RLRMtporttproxy((s+/usr/lib64/python2.7/Demo/pdist/RCSProxy.pyt test_server¨s   cCsÛddl}|jd s>|jdrU|jdddkrUtƒ|jdƒntƒ}|jd}t||ƒrÁt||ƒ}t|ƒr³t|t |jdƒƒGHq×t |ƒGHnd|GH|jdƒdS(Niÿÿÿÿiit 0123456789is%s: no such attribute( RMRNRStexitRthasattrtgetattrtcallabletapplyttupletrepr(RMRRtwhattattr((s+/usr/lib64/python2.7/Demo/pdist/RCSProxy.pyttest³s 2    t__main__((t__doc__RER)RtfnmatchRLttempfileR RR!RRFRDRSR^R(((s+/usr/lib64/python2.7/Demo/pdist/RCSProxy.pyts       *O