Viewing File: /usr/lib/python2.7/site-packages/paramiko/sftp_handle.pyc
ó
=OXc @ 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( ( s8 /usr/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
( ( s8 /usr/lib/python2.7/site-packages/paramiko/sftp_handle.pyR 5 s
c C sà t | d d ƒ } | d k r"