%PDF- %PDF-
Direktori : /opt/plesk/python/2.7/lib/python2.7/site-packages/paramiko/ |
Current File : //opt/plesk/python/2.7/lib/python2.7/site-packages/paramiko/sftp_handle.pyc |
� ��Abc @ sb d Z d d l Z d d l m Z m Z d d l m Z d e f d � � YZ d d l m Z d S( s7 Abstraction of an SFTP file handle (for server mode). i����N( t SFTP_OP_UNSUPPORTEDt SFTP_OK( t ClosingContextManagert SFTPHandlec B sk e Z d Z d d � Z d � Z d � Z d � Z d � Z d � Z d � Z d � Z d � Z d � Z RS( s� Abstract object representing a handle to an open file (or folder) in an SFTP server implementation. Each handle has a string representation used by the client to refer to the underlying file. Server implementations can (and should) subclass SFTPHandle to implement features of a file handle, like `stat` or `chattr`. Instances of this class may be used as context managers. i c C s( | | _ d | _ i | _ d | _ d S( s" Create a new file handle representing a local file being served over SFTP. If ``flags`` is passed in, it's used to determine if the file is open in append mode. :param int flags: optional flags as passed to `.SFTPServerInterface.open` N( t _SFTPHandle__flagst Nonet _SFTPHandle__namet _SFTPHandle__filest _SFTPHandle__tell( t selft flags( ( sI /opt/plesk/python/2.7/lib/python2.7/site-packages/paramiko/sftp_handle.pyt __init__( s c C sZ t | d d � } | d k r+ | j � n t | d d � } | d k rV | j � n d S( s When a client closes a file, this method is called on the handle. Normally you would use this method to close the underlying OS level file object(s). The default implementation checks for attributes on ``self`` named ``readfile`` and/or ``writefile``, and if either or both are present, their ``close()`` methods are called. This means that if you are using the default implementations of `read` and `write`, this method's default implementation should be fine also. t readfilet writefileN( t getattrR t close( R R R ( ( sI /opt/plesk/python/2.7/lib/python2.7/site-packages/paramiko/sftp_handle.pyR 7 s c C s� t | d d � } | d k r"