ok

Mini Shell

Direktori : /lib64/python2.7/Demo/pdist/
Upload File :
Current File : //lib64/python2.7/Demo/pdist/FSProxy.pyc

�
V
�Qc@s�dZddlZddlZddlZddlZddlZddlTddlZddlZdZej	ej
fZdd
d��YZdeej
fd��YZd	ejfd
��YZd�Zedkr�e�ndS(s�File System Proxy.

Provide an OS-neutral view on a file system, locally or remotely.
The functionality is geared towards implementing some sort of
rdist-like utility between a Mac and a UNIX system.

The module defines three classes:

FSProxyLocal  -- used for local access
FSProxyServer -- used on the server side of remote access
FSProxyClient -- used on the client side of remote access

The remote classes are instantiated with an IP address and an optional
verbosity flag.
i����N(t*i�tFSProxyLocalcBs�eZd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd+d�Zd+d�Zd+d
�Zd+d�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd+d�Zd+d�Zd+d�Zd+d�Zd+d�Z d�Z!d+d�Z"d+d �Z#d+d!�Z$d+d"�Z%d+d#�Z&d$d%d&�Z'd'�Z(d$d(�Z)d)�Z*d*�Z+RS(,cCs#g|_dg|j�|_dS(Ns*.pyc(t	_dirstackt_readignoret_ignore(tself((s*/usr/lib64/python2.7/Demo/pdist/FSProxy.pyt__init__!s	cCsx|jr|j�qWdS(N(Rtback(R((s*/usr/lib64/python2.7/Demo/pdist/FSProxy.pyt_close%scCs�|jd�}yt|�}WnEtk
rf|jd�}yt|�}Wqgtk
rbgSXnXg}xC|j�}|s�Pn|ddkr�|d }n|j|�qp|j�|S(Ntignoressynctree.ignorefilesi����s
(t_hidetopentIOErrortreadlinetappendtclose(RtfiletfR	tline((s*/usr/lib64/python2.7/Demo/pdist/FSProxy.pyR)s&

	

cCs|ddkS(Nit.((Rtname((s*/usr/lib64/python2.7/Demo/pdist/FSProxy.pyt_hidden<scCsd|S(Ns.%s((RR((s*/usr/lib64/python2.7/Demo/pdist/FSProxy.pyR
?scCs�t|�tkrdS|ddkr*dS|tkr:dS|j|�rMdStjj|�\}}|sr|rvdStjj|�r�dSdt|d�j	d�kr�dSx'|j
D]}tj||�r�dSq�WdS(Nii����t~ttrbii(tlent
maxnamelent	skipnamesRtostpathtsplittislinkRtreadRtfnmatch(RRtheadttailtign((s*/usr/lib64/python2.7/Demo/pdist/FSProxy.pytvisibleBs&
cCs,|j|�s(tjdt|��ndS(Nsprotected name %s(R%Rterrortrepr(RR((s*/usr/lib64/python2.7/Demo/pdist/FSProxy.pytcheckOscCs<|j|�tjj|�s8tjdt|��ndS(Nsnot a plain file %s(R(RRtisfileR&R'(RR((s*/usr/lib64/python2.7/Demo/pdist/FSProxy.pyt	checkfileSs
cCs
tj�S(N(Rtgetcwd(R((s*/usr/lib64/python2.7/Demo/pdist/FSProxy.pytpwdXscCsY|j|�tj�|jf}tj|�|jj|�|j|j�|_dS(N(R(RR+RtchdirRRR(RRtsave((s*/usr/lib64/python2.7/Demo/pdist/FSProxy.pytcd[s


cCsO|jstjd�n|jd\}}tj|�|jd=||_dS(Nsempty directory stacki����(RRR&R-R(RtdirR	((s*/usr/lib64/python2.7/Demo/pdist/FSProxy.pyRbs	

cCsD|r$|d�}t||�}nt|j|�}|j�|S(NcSstj||�S(N(R!(Rtpat((s*/usr/lib64/python2.7/Demo/pdist/FSProxy.pytkeepls(tfilterR%tsort(RtfilesR1R2((s*/usr/lib64/python2.7/Demo/pdist/FSProxy.pyt_filterjs
cCs"tjtj�}|j||�S(N(RtlistdirtcurdirR6(RR1R5((s*/usr/lib64/python2.7/Demo/pdist/FSProxy.pytlistsscCs7tjtj�}ttjj|�}|j||�S(N(RR7R8R3RR)R6(RR1R5((s*/usr/lib64/python2.7/Demo/pdist/FSProxy.pyt	listfileswscCs7tjtj�}ttjj|�}|j||�S(N(RR7R8R3RtisdirR6(RR1R5((s*/usr/lib64/python2.7/Demo/pdist/FSProxy.pytlistsubdirs|scCs|j|�otjj|�S(N(R%RRtexists(RR((s*/usr/lib64/python2.7/Demo/pdist/FSProxy.pyR=�scCs|j|�otjj|�S(N(R%RRR;(RR((s*/usr/lib64/python2.7/Demo/pdist/FSProxy.pyR;�scCs|j|�otjj|�S(N(R%RRR(RR((s*/usr/lib64/python2.7/Demo/pdist/FSProxy.pyR�scCs|j|�otjj|�S(N(R%RRR)(RR((s*/usr/lib64/python2.7/Demo/pdist/FSProxy.pyR)�scCsa|j|�d}t|�}tj�}x)|j|�}|sGPn|j|�q.|j�S(Niii (R*Rtmd5tnewR tupdatetdigest(RRt
BUFFERSIZERtsumtbuffer((s*/usr/lib64/python2.7/Demo/pdist/FSProxy.pyRC�s
cCs|j|�tj|�tS(N(R*RtstattST_SIZE(RR((s*/usr/lib64/python2.7/Demo/pdist/FSProxy.pytsize�s
cCs'|j|�tjtj|�t�S(N(R*ttimet	localtimeRREtST_MTIME(RR((s*/usr/lib64/python2.7/Demo/pdist/FSProxy.pytmtime�s
cCsF|j|�tj|�t}tjtj|�t�}||fS(N(R*RRERFRHRIRJ(RRRGRK((s*/usr/lib64/python2.7/Demo/pdist/FSProxy.pyRE�s
cCsK|j|�}tj|�t}tjtj|�t�}|||fS(N(RCRRERFRHRIRJ(RRRCRGRK((s*/usr/lib64/python2.7/Demo/pdist/FSProxy.pytinfo�scCs�|dkr|j�}ng}x[|D]S}y|j|||�f�Wq(tjtfk
rz|j|df�q(Xq(W|S(N(tNoneR:RRR&R(RtfunctionR9tresR((s*/usr/lib64/python2.7/Demo/pdist/FSProxy.pyt_list�s
cCs|j|j|�S(N(RPRC(RR9((s*/usr/lib64/python2.7/Demo/pdist/FSProxy.pytsumlist�scCs|j|j|�S(N(RPRE(RR9((s*/usr/lib64/python2.7/Demo/pdist/FSProxy.pytstatlist�scCs|j|j|�S(N(RPRK(RR9((s*/usr/lib64/python2.7/Demo/pdist/FSProxy.pyt	mtimelist�scCs|j|j|�S(N(RPRG(RR9((s*/usr/lib64/python2.7/Demo/pdist/FSProxy.pytsizelist�scCs|j|j|�S(N(RPRL(RR9((s*/usr/lib64/python2.7/Demo/pdist/FSProxy.pytinfolist�scCsg|dkr|j�}ni}x?|D]7}y||�||<Wq(tjtfk
r^q(Xq(W|S(N(RMR:RR&R(RRNR9tdictR((s*/usr/lib64/python2.7/Demo/pdist/FSProxy.pyt_dict�s
cCs|j|j|�S(N(RVRC(RR9((s*/usr/lib64/python2.7/Demo/pdist/FSProxy.pytsumdict�scCs|j|j|�S(N(RVRG(RR9((s*/usr/lib64/python2.7/Demo/pdist/FSProxy.pytsizedict�scCs|j|j|�S(N(RVRK(RR9((s*/usr/lib64/python2.7/Demo/pdist/FSProxy.pyt	mtimedict�scCs|j|j|�S(N(RVRE(RR9((s*/usr/lib64/python2.7/Demo/pdist/FSProxy.pytstatdict�scCs|j|j|�S(N(RWRL(RR9((s*/usr/lib64/python2.7/Demo/pdist/FSProxy.pytinfodict�sii����cCss|j|�t|�}|j|�|dkr;d}n*|dkrV|j�}n|j|�}|j�|S(Nit(R*RtseekR R(RRtoffsettlengthRtdata((s*/usr/lib64/python2.7/Demo/pdist/FSProxy.pyR �s

	
cCs�|j|�tjj|�rq|j|�|d}ytj|�Wntjk
r]nXtj||�nt|d�}|j	�dS(NRtw(
R(RRR=R*tunlinkR&trenameRR(RRtbnameR((s*/usr/lib64/python2.7/Demo/pdist/FSProxy.pytcreate�s


cCsD|j|�t|d�}|j|�|j|�|j�dS(Nsr+(R*RR^twriteR(RRRaR_R((s*/usr/lib64/python2.7/Demo/pdist/FSProxy.pyRg�s



cCs!|j|�tj|d�dS(Ni�(R(Rtmkdir(RR((s*/usr/lib64/python2.7/Demo/pdist/FSProxy.pyRhs
cCs|j|�tj|�dS(N(R(Rtrmdir(RR((s*/usr/lib64/python2.7/Demo/pdist/FSProxy.pyRis
N(,t__name__t
__module__RRRRR
R%R(R*R,R/RRMR6R9R:R<R=R;RR)RCRGRKRERLRPRQRRRSRTRURWRXRYRZR[R\R RfRgRhRi(((s*/usr/lib64/python2.7/Demo/pdist/FSProxy.pyRsR						
																	
	
	t
FSProxyServercBs)eZejd�Zd�Zd�ZRS(cCs'tj|�tjj|||�dS(N(RRtservertServer(Rtaddresstverbose((s*/usr/lib64/python2.7/Demo/pdist/FSProxy.pyR
s
cCs!tjj|�tj|�dS(N(RmRnRR(R((s*/usr/lib64/python2.7/Demo/pdist/FSProxy.pyRscCs.tjj|�x|jr)|j�qWdS(N(RmRnt_serveRR(R((s*/usr/lib64/python2.7/Demo/pdist/FSProxy.pyRqs(RjRkRmtVERBOSERRRq(((s*/usr/lib64/python2.7/Demo/pdist/FSProxy.pyRls	t
FSProxyClientcBseZejd�ZRS(cCstjj|||�dS(N(tclienttClientR(RRoRp((s*/usr/lib64/python2.7/Demo/pdist/FSProxy.pyRs(RjRkRtRrR(((s*/usr/lib64/python2.7/Demo/pdist/FSProxy.pyRsscCsdddl}ddl}|jdr>|j|jd�}nd}td|f�}|j�dS(Ni����iiR](tstringtsystargvtatoiRlt_serverloop(RvRwtporttproxy((s*/usr/lib64/python2.7/Demo/pdist/FSProxy.pyttest!s
t__main__((t__doc__RmRtR>RR!RERHRR8tpardirRRRnRlRuRsR}Rj(((s*/usr/lib64/python2.7/Demo/pdist/FSProxy.pyt<module>s 
�	

Zerion Mini Shell 1.0