ó =OXc@sjddlZddlZddlmZmZmZmZddlmZm Z de fd„ƒYZ dS(iÿÿÿÿN(t x80000000to700to70t xffffffff(tlongtbtSFTPAttributescBs¤eZdZdZdZdZdZeZd„Z e dd„ƒZ d„Z e ddd„ƒZd „Zd „Zd „Zeed „ƒZd „Zd„ZRS(sh Representation of the attributes of a file (or proxied file) for SFTP in client or server mode. It attemps to mirror the object returned by `os.stat` as closely as possible, so it may have the following fields, with the same meanings as those returned by an `os.stat` object: - ``st_size`` - ``st_uid`` - ``st_gid`` - ``st_mode`` - ``st_atime`` - ``st_mtime`` Because SFTP allows flags to have other arbitrary named attributes, these are stored in a dict named ``attr``. Occasionally, the filename is also stored, in ``filename``. iiiicCsLd|_d|_d|_d|_d|_d|_d|_i|_dS(sX Create a new (empty) SFTPAttributes object. All fields will be empty. iN( t_flagstNonetst_sizetst_uidtst_gidtst_modetst_atimetst_mtimetattr(tself((s6/usr/lib/python2.7/site-packages/paramiko/sftp_attr.pyt__init__2s       cCsm|ƒ}|j|_|j|_|j|_|j|_|j|_|j|_|dk ri||_n|S(s` Create an `.SFTPAttributes` object from an existing ``stat`` object (an object returned by `os.stat`). :param object obj: an object returned by `os.stat` (or equivalent). :param str filename: the filename associated with this file. :return: new `.SFTPAttributes` object with the same attribute fields. N(R R R R R RRtfilename(tclstobjRR((s6/usr/lib/python2.7/site-packages/paramiko/sftp_attr.pyt from_stat?s         cCsd|jƒS(Ns(t _debug_str(R((s6/usr/lib/python2.7/site-packages/paramiko/sftp_attr.pyt__repr__TscCsJ|ƒ}|j|ƒ|dk r.||_n|dk rF||_n|S(N(t_unpackRRtlongname(RtmsgRRR((s6/usr/lib/python2.7/site-packages/paramiko/sftp_attr.pyt _from_msgXs      cCs|jƒ|_|j|j@r1|jƒ|_n|j|j@rb|jƒ|_|jƒ|_n|j|j@r„|jƒ|_ n|j|j @rµ|jƒ|_ |jƒ|_ n|j|j @r|jƒ}x0t|ƒD]}|jƒ|j|jƒs  "